Beispiel #1
0
        // throws on error
        public KeyValueAST ParseKeyValue()
        {
            var ast = new KeyValueAST();
            ast.key = ParseIdentifier();

            if (Tok() != TokenType.Eq)
                throw new Exception(GetErrorMsg());
            Inc(); // skip '='

            ast.value = ParseValue();
            SkipIf(TokenType.Semicolon);

            return ast;
        }
Beispiel #2
0
        // throws on error
        public KeyValueAST ParseKeyValue()
        {
            var ast = new KeyValueAST();
            ast.key = ParseIdentifier();
          
            if (Tok() != TokenType.Eq)
                throw new Exception(GetErrorMsg());
            Inc(); // skip '='
                       
            ast.value = ParseValue();
            SkipIf(TokenType.Semicolon);

            return ast;
        }