3 public class ASTMemberInit : ASTNode
7 List<ASTIdentifier> identifiers;
8 ASTInitializer initializer;
15 ASTMemberInit ::parse()
17 ASTMemberInit init { };
20 ASTIdentifier id = ASTIdentifier::parse();
23 if(!init.identifiers) init.identifiers = { };
24 init.identifiers.Add(id);
25 if(peekToken().type != '.')
29 if(peekToken().type == '=')
32 init.initializer = ASTInitializer::parse();
41 Iterator<ASTIdentifier> it { identifiers };
45 if(identifiers.GetNext(it.pointer))
50 if(initializer) initializer.print();
54 public class MemberInitList : ASTList<ASTMemberInit>
56 MemberInitList ::parse()
58 MemberInitList list = (MemberInitList)ASTList::parse(class(MemberInitList), ASTMemberInit::parse, ',');
59 if(peekToken().type == ';')
65 public class ASTPropertyDef : ASTNode
68 ASTDeclarator declarator;
72 ASTStatement issetStmt;
76 ASTExpression category;
79 public class ClassDefList : ASTList<ASTClassDef>
81 ClassDefList ::parse()
83 return (ClassDefList)ASTList::parse(class(ClassDefList), ASTClassDef::parse, 0);
91 public class ASTClassDef : ASTNode
94 AccessMode memberAccess;
101 SpecsList specs = null;
102 InitDeclList decls = null;
106 if(nextToken.type == '}')
109 if(nextToken.type == IDENTIFIER)
112 specs = SpecsList::parse();
113 decls = InitDeclList::parse();
115 if(nextToken.type == '{' || (decls && decls[0] && decls[0].declarator && decls[0].declarator._class == class(DeclFunction)))
116 return ClassDefFunction::parse(specs, decls);
117 else if((specs || decls) && (nextToken.type != '.' && nextToken.type != '='))
119 if(a > -1) clearAmbiguity();
120 return ClassDefDeclaration::parse(specs, decls);
124 ClassDefInitialization init;
127 init = ClassDefInitialization::parse();
131 readToken(); // Error
136 public class ClassDefClassPropertyValue : ASTClassDef
139 ASTInitializer initializer;
142 public class ClassDefDeclaration : ASTClassDef
146 ClassDefDeclaration ::parse(SpecsList specs, InitDeclList decls)
148 ASTDeclaration decl = ASTDeclaration::parse(specs, decls);
151 return { decl = decl };
159 if(decl) decl.print();
164 public class ASTClassFunction : ASTFunctionDefinition
168 //List attached; // For IDE
176 bool isConstructor, isDestructor;
180 ASTClassFunction ::parse(SpecsList specs, InitDeclList decls)
182 return (ASTClassFunction)ASTFunctionDefinition::parse(specs, decls);
186 public class ClassDefFunction : ASTClassDef
188 ASTClassFunction function;
190 ClassDefFunction ::parse(SpecsList specs, InitDeclList decls)
192 ASTClassFunction function = ASTClassFunction::parse(specs, decls);
194 return { function = function };
200 if(function) function.print();
204 public class ClassDefInitialization : ASTClassDef
206 MemberInitList defValues;
208 ClassDefInitialization ::parse()
210 MemberInitList defValues = MemberInitList::parse();
212 return { defValues = defValues };
227 public class ClassDefProperty : ASTClassDef
229 ASTPropertyDef propertyDef;
232 public class ClassDefPropertyWatch : ASTClassDef
234 ASTPropertyWatch propertyWatch;
237 public class ClassDefDesigner : ASTClassDef
242 public class ClassDefDefaultProperty : ASTClassDef
244 ASTIdentifier defaultProperty;