#include <vuGuiParser.h>
Inheritance diagram for vuGuiParser:
Public Member Functions | |
vuGuiParser () | |
default constructor, does nothing | |
~vuGuiParser () | |
destrustor, does nothing | |
void | Parse (const char *filename) throw (const char *) |
Parses the given gui script file, and generates the corresponding class. | |
Private Member Functions | |
void | ParseGui () |
Parses a gui declaration. | |
void | ParseSections () |
Parses the different sections of a gui declaration. | |
void | ParseAPIs () |
Parses the API section of the gui declaration. | |
void | ParseControls (const char *Location) |
Parses the init section of the gui declaration. | |
vuString | ParseListBox (const char *Name) |
Parses a listbox declaration. | |
vuString | ParseSlider (const char *Name) |
Parses a slider declaration. | |
vuString | ParseButton (const char *Name) |
Parses a button declaration. | |
vuString | ParseCheckBox (const char *Name) |
Parse a checkbox declaration. | |
vuString | ParseRadioBox (const char *Name) |
Parse a radiobox declaration. | |
void | ParseMethod (const char *Header) |
Parses a block of code from the file and writes it as a method to the output file. | |
vuString | ParseStatement () |
Parses a statement from the file and translates it into a method call. | |
StringList | ParseList () |
Parses a list of identifiers from the file. | |
void | WriteData () |
Writes the accumulated control data to the files. | |
Private Attributes | |
ofstream | m_fHeader |
The output header file for the generated gui class. | |
ofstream | m_fImpl |
The output implemenation file for the generated gui class. | |
vuString | m_Name |
The name of the gui that is being read. | |
vuString | m_Base |
The utility base class that the gui is derived from. | |
StringList | m_Apis |
The header files to be included for the gui class. | |
StringList | m_Controls |
The names of the defined controls. |
This is the main class for the vuTextGui program. It accepts the filename of the gui script file, then parses and interprets the script. The text file is interpreted by sections, with an api section, and widget define sections. The syntax for this is described in the vuTextGui documentation.
The current implementation outputs the gui utility implementation as it read the script file. This was done to keep the difficulty of the coding in line with the importance of the text gui, ie not to overkill on design. The parser is therefore relatively simple and keeps to the task at hand.
Definition at line 25 of file vuGuiParser.h.
|
default constructor, does nothing
Definition at line 20 of file vuGuiParser.cpp. |
|
destrustor, does nothing
Definition at line 28 of file vuGuiParser.cpp. |
|
Parses the given gui script file, and generates the corresponding class.
Reimplemented from vuParser. Definition at line 36 of file vuGuiParser.cpp. Referenced by main(). |
|
Parses the API section of the gui declaration.
Definition at line 91 of file vuGuiParser.cpp. References vuDVector< T >::getLength(), m_fImpl, m_Name, ParseList(), vuParser::readToken(), and StringList. Referenced by ParseGui(). |
Here is the call graph for this function:
|
Parses a button declaration. The method parses a button define statement. It adds the name of the control to the control list, and generates the statements to initialize the control. The initialization statements are returned in a string.
Definition at line 487 of file vuGuiParser.cpp. References vuDVector< T >::add(), vuDVector< T >::getLength(), vuDVector< T >::isMember(), m_Controls, ParseList(), ParseMethod(), and StringList. Referenced by ParseControls(). |
Here is the call graph for this function:
|
Parse a checkbox declaration. The method parses a checkbox define statement. It adds the name of the control to the control list, and generates the statements to initialize the control. The initialization statements are returned in a string.
Definition at line 452 of file vuGuiParser.cpp. References vuDVector< T >::add(), vuDVector< T >::getLength(), vuDVector< T >::isMember(), m_Controls, ParseList(), ParseMethod(), and StringList. Referenced by ParseControls(). |
Here is the call graph for this function:
|
Parses the init section of the gui declaration.
Definition at line 147 of file vuGuiParser.cpp. References CONTROL_DEFINE, vuParser::finished(), m_fHeader, m_fImpl, m_Name, ParseButton(), ParseCheckBox(), ParseListBox(), ParseRadioBox(), ParseSlider(), and vuParser::readToken(). Referenced by ParseSections(). |
Here is the call graph for this function:
|
Parses a gui declaration.
Definition at line 50 of file vuGuiParser.cpp. References GUI_OPEN, m_Base, m_fHeader, m_fImpl, m_Name, ParseAPIs(), ParseSections(), and WriteData(). |
Here is the call graph for this function:
|
Parses a list of identifiers from the file.
Definition at line 184 of file vuGuiParser.cpp. References vuDVector< T >::add(), vuParser::finished(), vuParser::readToken(), STRING, and StringList. Referenced by ParseAPIs(), ParseButton(), ParseCheckBox(), ParseListBox(), ParseRadioBox(), and ParseSlider(). |
Here is the call graph for this function:
|
Parses a listbox declaration. The method parses a listbox define statement. It adds the name of the control to the control list, and generates the statements to initialize the control. The initialization statements are returned in a string.
Definition at line 342 of file vuGuiParser.cpp. References vuDVector< T >::add(), vuDVector< T >::getLength(), vuDVector< T >::isMember(), m_Controls, ParseList(), ParseMethod(), and StringList. Referenced by ParseControls(). |
Here is the call graph for this function:
|
Parses a block of code from the file and writes it as a method to the output file.
Definition at line 213 of file vuGuiParser.cpp. References vuParser::finished(), m_fHeader, m_fImpl, m_Name, ParseStatement(), and vuParser::readToken(). Referenced by ParseButton(), ParseCheckBox(), ParseListBox(), ParseRadioBox(), ParseSections(), and ParseSlider(). |
Here is the call graph for this function:
|
Parse a radiobox declaration. The method parses a radiobox define statement. It adds the name of the control to the control list, and generates the statements to initialize the control. The initialization statements are returned in a string.
Definition at line 410 of file vuGuiParser.cpp. References vuDVector< T >::add(), vuDVector< T >::getLength(), vuDVector< T >::isMember(), m_Controls, ParseList(), ParseMethod(), and StringList. Referenced by ParseControls(). |
Here is the call graph for this function:
|
Parses the different sections of a gui declaration.
Definition at line 115 of file vuGuiParser.cpp. References vuParser::finished(), ParseControls(), ParseMethod(), vuParser::readToken(), and SECTION_OPEN. Referenced by ParseGui(). |
Here is the call graph for this function:
|
Parses a slider declaration. The method parses a slider define statement. It adds the name of the control to the control list, and generates the statements to initialize the control. The initialization statements are returned in a string.
Definition at line 377 of file vuGuiParser.cpp. References vuDVector< T >::add(), vuDVector< T >::getLength(), vuDVector< T >::isMember(), m_Controls, ParseList(), ParseMethod(), and StringList. Referenced by ParseControls(). |
Here is the call graph for this function:
|
Parses a statement from the file and translates it into a method call.
Definition at line 232 of file vuGuiParser.cpp. References vuParser::finished(), vuDVector< T >::isMember(), m_Controls, vuParser::readToken(), and STRING. Referenced by ParseMethod(). |
Here is the call graph for this function:
|
Writes the accumulated control data to the files. This method writes out the statements common to all controls. It declares the controls in the header file, defines enum identifiers for their respective events, and registers the events. Definition at line 284 of file vuGuiParser.cpp. References vuString::c_str(), vuDVector< T >::getLength(), m_Base, m_Controls, m_fHeader, m_fImpl, and m_Name. Referenced by ParseGui(). |
Here is the call graph for this function:
|
The header files to be included for the gui class.
Definition at line 118 of file vuGuiParser.h. |
|
The utility base class that the gui is derived from.
Definition at line 116 of file vuGuiParser.h. Referenced by ParseGui(), and WriteData(). |
|
The names of the defined controls.
Definition at line 120 of file vuGuiParser.h. Referenced by ParseButton(), ParseCheckBox(), ParseListBox(), ParseRadioBox(), ParseSlider(), ParseStatement(), and WriteData(). |
|
The output header file for the generated gui class.
Definition at line 109 of file vuGuiParser.h. Referenced by ParseControls(), ParseGui(), ParseMethod(), and WriteData(). |
|
The output implemenation file for the generated gui class.
Definition at line 111 of file vuGuiParser.h. Referenced by ParseAPIs(), ParseControls(), ParseGui(), ParseMethod(), and WriteData(). |
|
The name of the gui that is being read.
Definition at line 114 of file vuGuiParser.h. Referenced by ParseAPIs(), ParseControls(), ParseGui(), ParseMethod(), and WriteData(). |