예제 #1
0
        public static PBXElementDict ParseTreeAST(TreeAST ast, TokenList tokens, string text)
        {
            var el = new PBXElementDict();

            foreach (var kv in ast.values)
            {
                PBXElementString key   = ParseIdentifierAST(kv.key, tokens, text);
                PBXElement       value = ParseValueAST(kv.value, tokens, text);
                el[key.value] = value;
            }
            return(el);
        }
예제 #2
0
파일: Parser.cs 프로젝트: trihards/SDmatch3
        public TreeAST ParseTree()
        {
            if (Tok() != TokenType.LBrace)
            {
                throw new Exception(GetErrorMsg());
            }
            Inc();

            var ast = new TreeAST();

            while (Tok() != TokenType.RBrace && Tok() != TokenType.EOF)
            {
                ast.values.Add(ParseKeyValue());
            }
            SkipIf(TokenType.RBrace);
            return(ast);
        }
예제 #3
0
        public TreeAST ParseTree()
        {
            if (Tok() != TokenType.LBrace)
                throw new Exception(GetErrorMsg());
            Inc();

            var ast = new TreeAST();
            while (Tok() != TokenType.RBrace && Tok() != TokenType.EOF)
            {
                ast.values.Add(ParseKeyValue());
            }
            SkipIf(TokenType.RBrace);
            return ast;
        }
 public static PBXElementDict ParseTreeAST(TreeAST ast, TokenList tokens, string text)
 {
     var el = new PBXElementDict();
     foreach (var kv in ast.values)
     {
         PBXElementString key = ParseIdentifierAST(kv.key, tokens, text);
         PBXElement value = ParseValueAST(kv.value, tokens, text);
         el[key.value] = value;
     }
     return el;
 }