Example #1
0
File: Parser.cs Project: azbyn/oop
 // main: expression
 void Main()
 {
     try {
         Result = Expression();
     } catch (ParserException p) {
         Error = p;
     }
 }
Example #2
0
File: Parser.cs Project: azbyn/oop
        //-----The recursive descent parser bit-----

        //return true on success
        public bool Parse(List <Token> tokens)
        {
            Error  = null;
            Result = null;
            if (tokens.Count == 0)
            {
                return(true);
            }
            this.tokens = tokens;
            pos         = 0;
            Main();
            return(Error == null);
        }