Structure declaration support.
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 *variableDeclaration(TokenKind kind);
51 bool matchName(String **name, TokenKind kind = TOK_NAME);
53 NameProxy *bind(Handle<String> name);
54 BoundName *bindType(Handle<String> string);
56 ExpressionList *dimensions();
59 Expression *primitive();
60 Expression *call(Expression *callee);
61 Expression *index(Expression *left);
63 Expression *primary();
65 Expression *multiplication();
66 Expression *addition();
68 Expression *bitand_();
71 Expression *relational();
75 Expression *ternary();
76 Expression *assignment();
77 Expression *expression();
82 Statement *block(Scope *scope = NULL);
83 Statement *function(TokenKind tok);
84 Statement *expressionStatement();
87 Statement *forStatement();
88 Statement *localStatement();
89 Statement *globalStatement();
90 Statement *returnStatement();
92 bool setupIntrinsics();
95 Parser(Zone *zone, CompileContext &cc, const char *stream, size_t length);
102 #endif // _include_jitcraft_parser_h_