public void Analy() { if (Raw == null || Raw.Properties == null) { return; } for (int i = 0; i < Raw.Properties.Count; i++) { PropertyASTRaw item = Raw.Properties[i]; string name = item.NameToken.Text; if (dict.ContainsKey(name)) { this.ASTEnum.FileContext.Errorf(item.NameToken.Position, "'{0}'重复", name); } else { dict.Add(name, item.NameToken); EnumItems.Add(name); } if (item.ValueExp != null) { this.ASTEnum.FileContext.Errorf(item.NameToken.Position, "约定类型的属性'{0}'不能有值", name); } } }
public SectionPropertiesClass(ClassAST classAST, SectionPropertiesRaw raw) { ASTClass = classAST; Raw = raw; PropertiesContext = new ContextMethod(ASTClass.ClassContext); for (int i = 0; i < Raw.Properties.Count; i++) { PropertyASTRaw item = Raw.Properties[i]; ClassPropertyAST p = new ClassPropertyAST(this, item); Propertys.Add(p); } }
public SectionPropertiesDim(DimAST dimAST, SectionPropertiesRaw raw) { this.dimAST = dimAST; Raw = raw; for (int i = 0; i < Raw.Properties.Count; i++) { PropertyASTRaw propertyRaw = Raw.Properties[i]; PropertyAST propertyAST = new PropertyAST(propertyRaw, this); PropertyASTList.Add(propertyAST); } }
private PropertyASTRaw ParseProperty() { PropertyASTRaw property = new PropertyASTRaw(); //property.FileContext = this.fileMY.FileContext; property.NameToken = (LexTokenText)tape.Current; tape.MoveNext(); if (tape.HasCurrent && tape.Current.IsKind(TokenKindSymbol.Assign)) { tape.MoveNext(); if (tape.HasCurrent) { ExpRaw exp = ParseRawExpPropertyValue(); if (exp != null) { property.ValueExp = exp; } } } return(property); }
public PropertyAST(PropertyASTRaw raw, SectionPropertiesDim parentAST) { Raw = raw; ParentAST = parentAST; }
public ClassPropertyAST(SectionPropertiesClass sectionProperties, PropertyASTRaw raw) { ParentProperties = sectionProperties; Raw = raw; ExpContext = new ContextExp(this.ParentProperties.PropertiesContext, null); }