Beispiel #1
0
        void parseAgreement()
        {
            var tempToken = CurrentToken;

            MoveNext(); //跳过"约定"
            MoveNext(); //跳过":"
            AgreementAST agreeast = new AgreementAST();

            agreeast.KeyToken = tempToken;
            List <Token> items = parseAgreementBlock(tempToken.Postion);

            agreeast.ValueList.AddRange(items);
            prog.Add(agreeast);
        }
Beispiel #2
0
 public EnumAST(FileAST fileAST)
 {
     this.fileAST = fileAST;
     if (fileAST.AgreementList.Count == 0)
     {
         errorf("不存在约定值");
     }
     else if (fileAST.AgreementList.Count > 1)
     {
         errorf("一个文件只能定义一个约定");
     }
     else
     {
         ast            = fileAST.AgreementList[0];
         nameToken      = fileAST.NameToken;
         ProjectContext = fileAST.ProjectContext;
     }
 }