示例#1
0
 public DimAST(FileAST astFile, SectionNameRaw nameSection, SectionExtendsRaw extendsSection, SectionPropertiesRaw propertiesSection)
     : base(astFile)//, nameSection)
 {
     DimNameSection = new SectionDimName(nameSection);
     Extends        = new SectionExtendsDim(extendsSection);
     Properties     = new SectionPropertiesDim(this, propertiesSection);
 }
示例#2
0
        private SectionRaw ParseSection()
        {
            string headText      = tape.Current.FirstToken.Text;
            bool   secondIsColon = tape.Current.SecondToken.IsKind(TokenKindSymbol.Colon);

            if (false)
            {
                //<<重新编写分析,同行换行都可以>>
            }
            else if (secondIsColon && headText == "导入包")
            {
                SectionImportRaw section = ParseImport();
                return(section);
            }
            else if (secondIsColon && headText == "导入类")
            {
                SectionUseRaw section = ParseUse();
                return(section);
            }
            //else if (secondIsColon && headText == "约定")
            //{
            //    SectionEnum section = ParseEnum();
            //    return section;
            //}
            else if (secondIsColon && headText == "名称")
            {
                SectionNameRaw section = ParseClassName();
                return(section);
            }
            else if (secondIsColon && headText == "属于")
            {
                SectionExtendsRaw section = ParseExtends();
                return(section);
            }
            //else if (secondIsColon && headText == "声明" )
            //{
            //    SectionDim section = ParseDim();
            //    return section;
            //}
            else if (secondIsColon && headText == "属性")
            {
                SectionPropertiesRaw section = ParseProperties();
                return(section);
            }
            else
            {
                SectionProcRaw section = ParseProc();
                return(section);
            }
        }
示例#3
0
        private SectionExtendsRaw ParseExtends()
        {
            SectionExtendsRaw   ast        = new SectionExtendsRaw();
            LexToken            headToken  = tape.Current.FirstToken;
            LineTokenCollection lineTokens = tape.Current;

            if (lineTokens.Count == 3)
            {
                ast.BaseTypeToken = (LexTokenText)lineTokens.Get(2);
            }
            else if (lineTokens.Count > 3)
            {
                error(lineTokens.Get(3), string.Format("不支持多继承'{0}'", lineTokens.Get(3)));
            }
            tape.MoveNext();
            return(ast);
        }
示例#4
0
        public ClassAST(FileAST astFile, SectionNameRaw nameSection, SectionExtendsRaw extendsSection
                        , SectionPropertiesRaw propertiesSection)
            : base(astFile)
        {
            this.ClassContext = new ContextClass(this.FileContext);
            ClassNameSection  = new SectionClassName(nameSection);
            Constructors      = new List <ProcConstructorBase>();
            Methods           = new List <ProcMethod>();


            Extends = new SectionExtendsClass(this, extendsSection);

            if (propertiesSection != null)
            {
                Properties = new SectionPropertiesClass(this, propertiesSection);
            }
        }
示例#5
0
 public SectionExtendsClass(ClassAST classAST, SectionExtendsRaw raw)
 {
     ASTClass = classAST;
     Raw      = raw;
 }
示例#6
0
 public SectionExtendsEnum(SectionExtendsRaw raw)
 {
     Raw = raw;
 }
示例#7
0
        //private DimAST dimAST;

        public SectionExtendsDim(SectionExtendsRaw raw)
        {
            Raw = raw;
        }