Ejemplo n.º 1
0
 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);
         }
     }
 }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 public PropertyAST(PropertyASTRaw raw, SectionPropertiesDim parentAST)
 {
     Raw       = raw;
     ParentAST = parentAST;
 }
Ejemplo n.º 6
0
 public ClassPropertyAST(SectionPropertiesClass sectionProperties, PropertyASTRaw raw)
 {
     ParentProperties = sectionProperties;
     Raw        = raw;
     ExpContext = new ContextExp(this.ParentProperties.PropertiesContext, null);
 }