3 public class ASTMemberInit : ASTNode
7 List<ASTIdentifier> identifiers;
8 ASTInitializer initializer;
15 ASTMemberInit ::parse()
17 ASTMemberInit init { };
18 if(peekToken().type == IDENTIFIER)
20 int a = pushAmbiguity();
23 ASTIdentifier id = ASTIdentifier::parse();
26 if(!init.identifiers) init.identifiers = { };
27 init.identifiers.Add(id);
28 if(peekToken().type != '.')
34 if(peekToken().type == '=')
42 init.initializer = InitExp::parse();
50 Iterator<ASTIdentifier> it { identifiers };
54 if(identifiers.GetNext(it.pointer))
64 public class MemberInitList : ASTList<ASTMemberInit>
66 MemberInitList ::parse()
68 MemberInitList list = (MemberInitList)ASTList::parse(class(MemberInitList), ASTMemberInit::parse, ',');
69 if(peekToken().type == ';')
75 public class ASTPropertyDef : ASTNode
78 ASTDeclarator declarator;
82 ASTStatement issetStmt;
86 ASTExpression category;
89 public class ClassDefList : ASTList<ASTClassDef>
91 ClassDefList ::parse()
93 return (ClassDefList)ASTList::parse(class(ClassDefList), ASTClassDef::parse, 0);
101 public class ASTClassDef : ASTNode
104 AccessMode memberAccess;
109 ASTClassDef ::parse()
111 SpecsList specs = null;
112 InitDeclList decls = null;
117 if(nextToken.type == '}')
120 if(nextToken.type == IDENTIFIER)
123 specs = SpecsList::parse();
124 decls = InitDeclList::parse();
126 decl = GetFuncDecl(decls && decls[0] ? decls[0].declarator : null);
129 if(a > -1) clearAmbiguity();
130 return ClassDefFunction::parse(specs, decls);
132 else if((specs || decls) && (nextToken.type != '.' && nextToken.type != '='))
134 if(a > -1) clearAmbiguity();
135 return ClassDefDeclaration::parse(specs, decls);
139 ClassDefInitialization init;
142 init = ClassDefInitialization::parse();
146 readToken(); // Error
151 public class ClassDefClassPropertyValue : ASTClassDef
154 ASTInitializer initializer;
157 public class ClassDefDeclaration : ASTClassDef
161 ClassDefDeclaration ::parse(SpecsList specs, InitDeclList decls)
163 ASTDeclaration decl = ASTDeclaration::parse(specs, decls);
166 return { decl = decl };
174 if(decl) decl.print();
179 public class ASTClassFunction : ASTFunctionDefinition
183 //List attached; // For IDE
191 bool isConstructor, isDestructor;
195 ASTClassFunction ::parse(SpecsList specs, InitDeclList decls)
197 return (ASTClassFunction)ASTFunctionDefinition::parse(specs, decls);
201 public class ClassDefFunction : ASTClassDef
203 ASTClassFunction function;
205 ClassDefFunction ::parse(SpecsList specs, InitDeclList decls)
207 ASTClassFunction function = ASTClassFunction::parse(specs, decls);
209 return { function = function };
215 if(function) function.print();
219 public class ClassDefInitialization : ASTClassDef
221 MemberInitList defValues;
223 ClassDefInitialization ::parse()
225 MemberInitList defValues = MemberInitList::parse();
227 return { defValues = defValues };
242 public class ClassDefProperty : ASTClassDef
244 ASTPropertyDef propertyDef;
247 public class ClassDefPropertyWatch : ASTClassDef
249 ASTPropertyWatch propertyWatch;
252 public class ClassDefDesigner : ASTClassDef
257 public class ClassDefDefaultProperty : ASTClassDef
259 ASTIdentifier defaultProperty;