Fix bug in bytecode resizing.
1 /* vim: set ts=4 sw=4 tw=99 et:
3 * Copyright (C) 2012 David Anderson
5 * This file is part of SourcePawn.
7 * SourcePawn is free software: you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License as published by the Free
9 * Software Foundation, either version 3 of the License, or (at your option)
12 * SourcePawn is distributed in the hope that it will be useful, but WITHOUT ANY
13 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with
17 * SourcePawn. If not, see http://www.gnu.org/licenses/.
19 #ifndef _include_jitcraft_parser_h_
20 #define _include_jitcraft_parser_h_
37 PoolList<NameProxy *> *unbound_;
38 bool encounteredReturn_;
41 void redeclarationError(BoundName *name);
42 bool peek(TokenKind kind);
43 bool match(TokenKind kind);
44 bool expect(TokenKind kind);
45 bool matchSemicolon();
47 Scope *enterScope(Scope::Kind kind);
50 VariableDeclaration *var(TokenKind scope, TokenKind kind);
51 Statement *vars(TokenKind scope, TokenKind kind);
52 bool matchName(String **name, TokenKind kind = TOK_NAME);
54 NameProxy *bind(Handle<String> name);
55 BoundName *bindType(Handle<String> string);
57 ExpressionList *dimensions();
60 Expression *primitive();
61 Expression *call(Expression *callee);
62 Expression *field(Expression *left);
63 Expression *index(Expression *left);
65 Expression *primary();
67 Expression *multiplication();
68 Expression *addition();
70 Expression *bitand_();
73 Expression *relational();
77 Expression *ternary();
78 Expression *assignment();
79 Expression *expression();
85 Statement *block(Scope *scope = NULL);
86 Statement *function(TokenKind tok);
87 Statement *expressionStatement();
90 Statement *forStatement();
91 Statement *localStatement();
92 Statement *globalStatement();
93 Statement *returnStatement();
95 bool setupIntrinsics();
98 Parser(Zone *zone, CompileContext &cc, const char *stream, size_t length);
105 #endif // _include_jitcraft_parser_h_