예제 #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);
        }
예제 #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;
		}