2 Copyright (C) 2003 by Walter Schreppers
3 Copyright (C) 2004 by Cies Breijs
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of version 2 of the GNU General Public
7 License as published by the Free Software Foundation.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 class Parser
: public QObject
34 Parser(QTextIStream
& in
);
38 TreeNode
* getTree() const { return tree
; }
42 void ErrorMsg(Token
&, const QString
&, uint code
);
50 void matchToken(int tokenType
);
51 void appendParameters(TreeNode
* node
);
52 void Error(Token
&, const QString
& s
, uint code
);
55 TreeNode
* ParamList();
57 TreeNode
* Statement();
59 TreeNode
* ExternalRun();
62 TreeNode
* signedFactor();
65 TreeNode
* Expression();
67 TreeNode
* Assignment(Token
);
68 TreeNode
* FunctionCall(Token
);
84 TreeNode
* Direction();
86 TreeNode
* TurnRight();
88 TreeNode
* SetPenWidth();
91 TreeNode
* SetFgColor();
92 TreeNode
* SetBgColor();
93 TreeNode
* ResizeCanvas();
94 TreeNode
* SpriteShow();
95 TreeNode
* SpriteHide();
96 TreeNode
* SpritePress();
97 TreeNode
* SpriteChange();
100 TreeNode
* InputWindow();
102 TreeNode
* FontType();
103 TreeNode
* FontSize();
111 TreeNode
* LineBreak();
112 TreeNode
* EndOfFile();
120 Token preservedToken
; // to preserve the currentToken so it wont get lost
123 QStringList learnedFunctionList
;