Example #1
0
 private object Parse (Token token)
 {
     if (token.Type == TokenType.ObjectStart) {
         return ParseObject ();
     } else if (token.Type == TokenType.ArrayStart) {
         return ParseArray ();
     }
     
     return token.Value;
 }
Example #2
0
 private void UnexpectedToken (TokenType expected, Token got)
 {
     throw new ApplicationException (String.Format ("Unexpected token {0} at [{1}:{2}]; expected {3}", 
         got.Type, got.SourceLine, got.SourceColumn, expected));
 }