예제 #1
0
파일: Parser.cs 프로젝트: trihards/SDmatch3
        // 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);
        }
예제 #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;
        }