diff -r b029d63565a2 -r c1ba166f3fc4 src/Parser.h --- a/src/Parser.h Mon Sep 17 00:10:01 2012 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* vim: set ts=4 sw=4 tw=99 et: - * - * Copyright (C) 2012 David Anderson - * - * This file is part of SourcePawn. - * - * SourcePawn is free software: you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free - * Software Foundation, either version 3 of the License, or (at your option) - * any later version. - * - * SourcePawn is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with - * SourcePawn. If not, see http://www.gnu.org/licenses/. - */ -#ifndef _include_jitcraft_parser_h_ -#define _include_jitcraft_parser_h_ - -#include -#include "AST.h" -#include "Scanner.h" -#include "Scopes.h" -#include "Strings.h" - -namespace ke { - -class Parser -{ - Zone *zone_; - CompileContext &cc_; - PoolAllocator &pool_; - Scanner scanner_; - Scope *scope_; - PoolList *unbound_; - bool encounteredReturn_; - - private: - void redeclarationError(BoundName *name); - bool peek(TokenKind kind); - bool match(TokenKind kind); - bool expect(TokenKind kind); - bool matchSemicolon(); - - Scope *enterScope(Scope::Kind kind); - - - VariableDeclaration *var(TokenKind scope, TokenKind kind); - Statement *vars(TokenKind scope, TokenKind kind); - bool matchName(String **name, TokenKind kind = TOK_NAME); - - NameProxy *bind(Handle name); - BoundName *bindType(Handle string); - - ExpressionList *dimensions(); - String *expectName(); - - Expression *primitive(); - Expression *arrayLiteral(TokenKind kind); - Expression *call(Expression *callee); - Expression *field(Expression *left); - Expression *index(Expression *left); - Expression *prefix(); - Expression *primary(); - Expression *unary(); - Expression *multiplication(); - Expression *addition(); - Expression *shift(); - Expression *bitand_(); - Expression *bitxor(); - Expression *bitor_(); - Expression *relational(); - Expression *equals(); - Expression *and_(); - Expression *or_(); - Expression *ternary(); - Expression *assignment(); - Expression *expression(); - - Statement *switch_(); - Statement *struct_(); - Statement *enum_(); - Statement *if_(); - Statement *block(Scope *scope = NULL); - Statement *function(TokenKind tok); - Statement *expressionStatement(); - Statement *while_(); - Statement *do_(); - Statement *forStatement(); - Statement *localStatement(); - Statement *globalStatement(); - Statement *returnStatement(); - - bool setupIntrinsics(); - - public: - Parser(Zone *zone, CompileContext &cc, const char *stream, size_t length); - - ParseTree *parse(); -}; - -} - -#endif // _include_jitcraft_parser_h_