Classes | |
class | Node |
Root node class, can save / load itself to its own file format, as well as be converted to 3ac subclasses declare the attributes they must have subclasses implement to3ac functionality. More... | |
class | List |
Special node type subclasses to contain a list of other nodes. More... | |
class | Leaf |
class | Program |
Root Program node. More... | |
class | Def_Function |
Function Declaration. More... | |
class | Def_Struct |
Struct. More... | |
class | If |
Conditional -> If. More... | |
class | Jump |
break or continue More... | |
class | Loop |
for or while or do while More... | |
class | Return |
return More... | |
class | Op_Unary |
Unary Operation ++ -- * - sizeof. More... | |
class | Op_Binary |
Binary operation -> + - < > ... More... | |
class | Op_Ternary |
a?b:c; More... | |
class | Assignment |
a = b; b *= c; c = d More... | |
class | Constant |
5.0 More... | |
class | FunctionCall |
func(x,y,z) More... | |
class | Identifier |
x More... | |
class | Op_Bracket |
a[5] More... | |
class | Op_Dot |
x.y More... | |
class | Def_Var |
int x More... | |
class | Def_Array |
int x More... | |
class | AttributeProxy |
Attribute proxy allows some nicer ways to access the attributes then using set/get attributes Attribute proxy allows some nicer ways to access the attributes then using set/get attributes. More... | |
Functions | |
Node * | fromASTFile (FILE *f) |
Parse a .ast file and construct / return an AST from it. | |
Node * | fromASTFile (FILE *f) |
Parse a .ast file and construct / return an AST from it. |
|
Parse a .ast file and construct / return an AST from it. Parse the astfile, building the astree as we go, then return said tree Use a boost.spirit parser to parse back in that beautiful, but hard to parse file It parses out the relavent tokens, and using several stacks pushes data together in the right way Definition at line 210 of file ast_fromastfile.cc. References stack_wrapped_node. 00210 { 00211 printf("fromASTFile(%p)\n", f); 00212 string str; 00213 char s[1024]; 00214 vector<string> v; 00215 while (fgets(s, 1024, f)) { 00216 if (s[0] == '\0') 00217 break; 00218 str += s; 00219 } 00220 ASTreeGrammar grammar; 00221 00222 bool b = parse(str.c_str(), grammar, space_p).full; 00223 printf(b ? "ParsingSuccesful\n" : "Parsing Failed\n"); 00224 Node* root = stack_wrapped_node.back(); 00225 return root; 00226 }
|
|
Parse a .ast file and construct / return an AST from it. Parse the astfile, building the astree as we go, then return said tree Use a boost.spirit parser to parse back in that beautiful, but hard to parse file It parses out the relavent tokens, and using several stacks pushes data together in the right way Definition at line 210 of file ast_fromastfile.cc. References stack_wrapped_node. 00210 { 00211 printf("fromASTFile(%p)\n", f); 00212 string str; 00213 char s[1024]; 00214 vector<string> v; 00215 while (fgets(s, 1024, f)) { 00216 if (s[0] == '\0') 00217 break; 00218 str += s; 00219 } 00220 ASTreeGrammar grammar; 00221 00222 bool b = parse(str.c_str(), grammar, space_p).full; 00223 printf(b ? "ParsingSuccesful\n" : "Parsing Failed\n"); 00224 Node* root = stack_wrapped_node.back(); 00225 return root; 00226 }
|