amath  1.8.5
Simple command line calculator
parser.cpp
Go to the documentation of this file.
1 /*-
2  * Copyright (c) 2014-2018 Carsten Sonne Larsen <cs@innolan.net>
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  *
25  * Project homepage:
26  * https://amath.innolan.net
27  *
28  */
29 
30 #include "amath.h"
31 #include "amathc.h"
32 #include "parser.h"
33 #include "values.h"
34 #include "operators.h"
35 #include "statements.h"
36 #include "userfunction.h"
37 #include "lib/numb.h"
38 #include "lib/cplex.h"
39 #include "lib/ntextd.h"
40 #include "loc/text.h"
41 #include "system/program.h"
42 
43 Parser::Parser(const char* input)
44 {
45  lexer = new Lexer(input);
46  token = nullptr;
47  errorNode = nullptr;
48  syntaxError = 0;
49 }
50 
52 {
53  delete lexer;
54 }
55 
57 {
59  token = nullptr;
60 
61  StatementBlockNode* block = nullptr;
62  SyntaxNode* result;
63  Token* current;
64 
65  do
66  {
67  result = TryParseStatement();
68 
69  GetToken();
70  if (token->symbol == symdelimiter || (token->symbol == symend && block != nullptr))
71  {
72  if (block == nullptr)
73  {
74  block = new StatementBlockNode();
75  }
76 
77  if (result != nullptr)
78  {
79  block->Add(result);
80  }
81 
82  while (token->symbol == symdelimiter)
83  {
84  GetToken();
85  }
86  }
87  else if (token->symbol != symend)
88  {
89  if (result != nullptr)
90  {
91  delete result;
92  }
93 
94  if (block == nullptr)
95  {
96  block = new StatementBlockNode();
97  }
98 
100  block->Add(result);
101 
102  // Skip until next statement
103  do
104  {
105  GetToken();
106  }
108  }
109 
110  current = token;
111  PutToken();
112  }
113  while (current->symbol != symend);
114 
115  if (block != nullptr)
116  return block;
117 
118  if (result == nullptr)
119  return new EmptyStatement();
120 
121  return result;;
122 }
123 
125 {
126  GetToken();
128  {
129  PutToken();
130  return nullptr;
131  }
132  PutToken();
133 
134  errorNode = nullptr;
135  syntaxError = -1;
136  SyntaxNode* result = ParseStatement();
137 
138  if (errorNode == nullptr && syntaxError != -1)
139  {
141  }
142 
143  if (errorNode != nullptr)
144  {
145  delete result;
146  result = errorNode;
147  }
148 
149  return result;
150 }
151 
152 // -----------------------------------------------------
153 // -------------- Recursive-descent logic --------------
154 // -----------------------------------------------------
155 
157 {
158  SyntaxNode* res;
159 
160  GetToken();
161  switch (token->symbol)
162  {
163  case symhelp:
164  res = ParseHelpStatement();
165  break;
166  case symdelete:
168  break;
169  case symdef:
170  res = ParseFunctionDef();
171  break;
172 #if defined(UNIX) || defined(HAIKU) || defined(AMIGA)
173  case symlist:
174  res = ParseListStatement();
175  break;
176 #endif
177  case symshow:
178  case symload:
179  case symsave:
180  case symexecute:
181  res = ParseFileStatement();
182  break;
183  case syminput:
184  case symoutput:
186  break;
187  case symprompt:
189  break;
190  case symprefs:
191  res = ParsePrefsStatement();
192  break;
193  case symdigits:
195  break;
196  case symdraw:
197  case symplot:
198  res = ParseDrawStatement();
199  break;
200  case symabout:
201  res = new AboutStatement();
202  break;
203  case symlicense:
204  res = new LicenseStatement();
205  break;
206  case symversion:
207  res = new VersionStatement();
208  break;
209  case symexit:
210  res = new ExitStatement();
211  break;
212 #if defined(AMIGA) || defined(TERMIOS) || defined(WINDOWS)
213  case symclear:
214  res = new ClearStatement();
215  break;
216 #endif
217  case symmem:
218  res = new MemoryStatement();
219  break;
220  case symvariable:
221  res = new ListVariablesStatement();
222  break;
223  case symfunction:
224  res = new ListFunctionsStatement();
225  break;
226  case symeval:
228  break;
229  default:
230  PutToken();
231  res = ParseDefault();
232  }
233 
234  return res;
235 }
236 
238 {
239  Token* temp = token;
240 
241  // Peek tokens
242  bool funcdef = Expect(symident);
243  funcdef = funcdef && Expect(symlparen);
244  funcdef = funcdef && Expect(symident);
245  funcdef = funcdef && Expect(symrparen);
246  funcdef = funcdef && Expect(symassign);
247 
248  // Restart parsing
249  syntaxError = -1;
250  errorNode = nullptr;
251  token = temp;
252 
253  if (funcdef)
254  {
255  return ParseFunctionDef();
256  }
257 
258  return ParseEvaluation();
259 }
260 
262 {
264  if (exp == nullptr)
265  {
266  return nullptr;
267  }
268 
269  StatementNode* sta = new EvalStatement(exp);
270  if (exp->IsSilent())
271  {
272  sta = new SilentStatement(sta);
273  }
274 
275  return sta;
276 }
277 
279 {
280  return ParseAddSubstract();
281 }
282 
284 {
286 
287  GetToken();
289  {
290  if (token->symbol == symplus)
291  {
292  node = new AdditionNode(node, ParseFactor());
293  }
294  else if (token->symbol == symminus)
295  {
296  node = new SubtractionNode(node, ParseFactor());
297  }
298 
299  GetToken();
300  }
301 
302  PutToken();
303  return node;
304 }
305 
307 {
309 
310  GetToken();
312  {
313  if (token->symbol == symtimes)
314  {
315  node = new MultiplicationNode(node, ParsePower());
316  }
317  else if (token->symbol == symslash)
318  {
319  node = new DivisionNode(node, ParsePower());
320  }
321 
322  GetToken();
323  }
324 
325  PutToken();
326  return node;
327 }
328 
330 {
332 
333  GetToken();
334  while (token->symbol == sympower)
335  {
336  node = new PowerNode(node, ParseUnary());
337  GetToken();
338  }
339 
340  PutToken();
341  return node;
342 }
343 
345 {
346  ExpressionNode* node;
347 
348  GetToken();
349  if (token->symbol == symminus)
350  {
351  node = new UnaryNode(ParseAtomic());
352  }
353  else
354  {
355  PutToken();
356  node = ParseAtomic();
357  }
358 
359  return node;
360 }
361 
363 {
364  ExpressionNode* node;
365 
366  GetToken();
367  if (token->symbol == symlparen)
368  {
369  node = ParseExpression();
371  }
372  else if (token->symbol == symabsolute)
373  {
376  }
377  else if (token->symbol == symident)
378  {
379  node = ParseIdent();
380  }
381  else if (token->symbol == sympi)
382  {
383  node = new PiNode();
384  }
385  else if (token->symbol == syme)
386  {
387  node = new EulersNumberNode();
388  }
389  else if (token->symbol == symi)
390  {
391  node = new ComplexiNode();
392  }
393  else if (token->symbol == symins)
394  {
395  node = new InsVariableNode();
396  }
397  else if (token->symbol == symnumber)
398  {
399  node = ParseNumber();
400  }
401  else
402  {
403  node = new NumericValueNode();
405  }
406 
408  {
409  GetToken();
410  node = new FactorialNode(node);
411  }
412 
413  return node;
414 }
415 
417 {
418  ExpressionNode* node;
419  Token* identToken = token;
420 
421  GetToken();
422  if (token->symbol == symlparen)
423  {
424  ExpressionNode* parameter = ParseExpression();
426  node = Program->Functions->GetFunctionCall(identToken->GetText(), parameter);
427 
428  if (node == nullptr)
429  {
430  errorNode = new ErrorNode(
433  identToken->GetText(),
434  identToken->GetPos());
435 
436  delete parameter;
437  node = new NumericValueNode();
438  }
439  }
440  else if (token->symbol == symassign)
441  {
442  Variable* var = Program->Variables->CreateVariable(identToken->GetText());
444  }
445  else
446  {
447  PutToken();
449 
450  if (var == nullptr)
451  {
452  errorNode = new ErrorNode(
455  identToken->GetText(),
456  identToken->GetPos());
457 
458  node = new NumericValueNode();
459  }
460  else
461  {
462  node = new VariableNode(var);
463  }
464  }
465 
466  return node;
467 }
468 
470 {
471  const char* a = token->GetText();
472  Number* number;
473 
474  GetToken();
475  if (token->symbol == symi)
476  {
477  Number* imag = Program->Input->Parse(a);
478  number = new ComplexNumber(0.0, imag->GetRealValue());
479  delete imag;
480  }
481  else
482  {
483  PutToken();
484  number = Program->Input->Parse(a);
485  }
486 
487  return new NumericValueNode(number);
488 }
489 
490 // -----------------------------------------------------
491 // ------------------- Token logic ---------------------
492 // -----------------------------------------------------
493 
495 {
496  if (token == nullptr)
497  {
499  }
500  else
501  {
503  }
504 }
505 
506 Token* Parser::Peek() const
507 {
508  if (token == nullptr)
509  return lexer->GetFirstToken();
510 
511  return token->GetNextToken();
512 }
513 
515 {
517 }
518 
519 bool Parser::Expect(Symbol symbol)
520 {
521  GetToken();
522  if (token->symbol != symbol)
523  {
525  return false;
526  }
527 
528  return true;
529 }
530 
531 // -----------------------------------------------------
532 // ----------------- Statement logic -------------------
533 // -----------------------------------------------------
534 
536 {
538  Token* funcToken = token;
541  Token* funcVariable = token;
544 
545  if (Program->Functions->IsSystemFunction(funcToken->GetText()))
546  {
547  errorNode = new ErrorNode(
550  funcToken->GetText(),
551  funcToken->GetPos());
552 
553  return nullptr;
554  }
555 
556  UserFunction* function = Program->Functions->GetFunctionDef(funcToken->GetText());
557  Variable* variable = function->CreateVariable(funcVariable->GetText());
561 
562  // TODO: Move logic to FunctionDefinitionNode
563  return new FunctionDefinitionNode();
564 }
565 
567 {
568  GetToken();
569 
571  {
572  PutToken();
573  return new HelpStatement();
574  }
575 
576  if (token->symbol == symident)
578 
579  return new HelpStatement(token->symbol);
580 }
581 
583 {
584  GetToken();
586  {
588  }
589 
590  if (token->symbol != symident)
591  {
593  return nullptr;
594  }
595 
596  Token* identToken = token;
597 
598  GetToken();
599  if (token->symbol == symlparen)
600  {
602  Token* parameter = token;
604  return new DeleteStatement(identToken->GetText(), parameter->GetText());
605  }
606 
607  PutToken();
609 }
610 
612 {
613  GetToken();
614  if (token->symbol == symqident)
616 
618  {
619  PutToken();
620  return new ListStatement();
621  }
622 
624  return nullptr;
625 }
626 
628 {
629  Token* statement = token;
630 
632  Token* identToken = token;
633 
634  if (statement->symbol == symload)
635  return new LoadStatement(identToken->GetText());
636 
637  if (statement->symbol == symsave)
638  return new SaveStatement(identToken->GetText());
639 
640  if (statement->symbol == symexecute)
641  return new ExecuteStatement(identToken->GetText());
642 
643  if (statement->symbol == symshow)
644  return new ShowStatement(identToken->GetText());
645 
646  return new ErrorNode(
649  statement->GetPos());
650 }
651 
653 {
654  Token* statement = token;
655  unsigned int base;
656 
657  GetToken();
658  switch (token->symbol)
659  {
660  case symend:
661  case symdelimiter:
662  PutToken();
663  return (statement->symbol == syminput)
664  ? static_cast<SyntaxNode*>(new InputStatement())
665  : static_cast<SyntaxNode*>(new OutputStatement());
666  case symbin:
667  base = 2;
668  break;
669  case symoct:
670  base = 8;
671  break;
672  case symdec:
673  base = 10;
674  break;
675  case symhex:
676  base = 16;
677  break;
678  default:
679  base = 0;
680  }
681 
682  if (base == 0 && token->symbol != symnumber)
683  {
685  return nullptr;
686  }
687 
688  if (base == 0)
689  {
690  NumeralSystem* nsys = new DecimalSystem(0);
691  Number* number = nsys->Parse(token->GetText());
692  base = number->GetIntegerValue();
693  delete number;
694  delete nsys;
695 
696  if (base < 2 || base > 32)
697  {
698  errorNode = new ErrorNode(
703 
704  return nullptr;
705  }
706  }
707 
708  return (statement->symbol == syminput)
709  ? static_cast<SyntaxNode*>(new InputStatement(base))
710  : static_cast<SyntaxNode*>(new OutputStatement(base));
711 }
712 
714 {
715  GetToken();
717  {
718  PutToken();
719  return new DigitsStatement();
720  }
721 
722  if (token->symbol != symnumber)
723  {
725  return nullptr;
726  }
727 
728  NumeralSystem* nsys = new DecimalSystem(0);
729  Number* number = nsys->Parse(token->GetText());
730  int digits = number->GetIntegerValue();
731  delete number;
732  delete nsys;
733 
734  if (digits < 0 || digits > 15)
735  {
736  errorNode = new ErrorNode(
741 
742  return nullptr;
743  }
744 
745  return new DigitsStatement(digits);
746 }
747 
749 {
750  GetToken();
751  if (token->symbol == symqident)
752  {
754  }
755 
756  PutToken();
757  return nullptr;
758 }
759 
761 {
762  GetToken();
764  {
766  }
767 
768  PutToken();
769  return new PrefsStatement();;
770 }
771 
773 {
774  Token* statement = token;
775 
777  Token* identToken = token;
780  Token* paramToken = token;
782 
783  if (statement->symbol == symplot)
784  return new PlotStatement(identToken->GetText(), paramToken->GetText());
785 
786  return new DrawStatement(identToken->GetText(), paramToken->GetText());
787 }
PiNode()
Definition: values.cpp:457
InputStatement(unsigned int base)
Constructor used to set number of active digits.
Definition: input.cpp:47
ErrorNode(const char *input, const char *message, const char *parameter, int pos)
Definition: nodes.cpp:133
#define TERMIOS
Definition: amath.h:89
Definition: symbol.h:84
virtual int GetIntegerValue()=0
Definition: symbol.h:93
Use of the square root of -2 in a syntax tree.
Definition: values.h:202
DivisionNode(ExpressionNode *left, ExpressionNode *right)
Definition: operators.cpp:519
SilentStatement(StatementNode *statement)
Definition: silent.cpp:33
InputStatement()
Constructor used to show number of active digits.
Definition: input.cpp:38
AbsoluteNode(ExpressionNode *expression)
Definition: operators.cpp:139
void Add(SyntaxNode *node)
Definition: nodes.cpp:244
#define EMPTYSTRING
Definition: amath.h:213
Delete variable or function.
Definition: delete.h:39
AboutStatement()
Definition: about.cpp:33
Definition: symbol.h:90
ExpressionNode * ParsePower()
Definition: parser.cpp:329
ExpressionNode * ParseExpression()
Definition: parser.cpp:278
Logic related to the help statement.
Definition: help.h:39
A user defined variable.
Definition: values.h:76
A sequence of statements in a syntax tree.
Definition: nodes.h:151
ListStatement(const char *directory)
Definition: list.cpp:42
Encapsulates an lexical analyzer. Provides token for the parser.
Definition: lexer.h:48
HelpStatement(const char *ident)
Definition: help.cpp:50
Base class for all statements in a syntax tree.
Definition: node.h:40
SyntaxNode * ParseEvaluation()
Definition: parser.cpp:261
Set number of significant digits to show.
Definition: digits.h:39
Definition: symbol.h:76
Token * token
Definition: parser.h:66
Evaluate arithmetic expression.
Definition: eval.h:39
SyntaxNode * ParseDefault()
Definition: parser.cpp:237
Definition: symbol.h:82
Base class for all nodes in a syntax tree.
Definition: nodes.h:65
NumericValueNode(Number *value)
Definition: values.cpp:376
Definition: symbol.h:92
bool Expect(Symbol symbol)
Definition: parser.cpp:519
ExpressionNode * ParseAddSubstract()
Definition: parser.cpp:283
~Parser()
Definition: parser.cpp:51
PrefsStatement(Symbol argument)
Definition: prefs.cpp:41
ExecuteStatement(const char *file)
Definition: execute.cpp:37
Token * Peek() const
Definition: parser.cpp:506
SyntaxNode * ParsePromptStatement()
Definition: parser.cpp:748
ErrorNode * errorNode
Definition: parser.h:69
PowerNode(ExpressionNode *left, ExpressionNode *right)
Definition: operators.cpp:545
Lexer * lexer
Definition: parser.h:65
Tokens are created by the Lexical Analyzer and provides an intermediate state for input consumed by t...
Definition: token.h:46
PlotStatement(const char *name, const char *parameter)
Definition: plot.cpp:46
SyntaxNode * ParseDeleteStatement()
Definition: parser.cpp:582
DeleteStatement(const char *name, const char *argument)
Constructor used to delete a function.
Definition: delete.cpp:64
MultiplicationNode(ExpressionNode *left, ExpressionNode *right)
Definition: operators.cpp:493
Use of PI in a syntax tree.
Definition: values.h:188
Variable * InsertTemporaryVariable(Variable *variable)
Definition: values.cpp:200
#define HELPPDIGITS
Definition: text.h:84
Definition: numb.h:66
Variable * GetVariable(const char *name) const
Definition: values.cpp:160
Definition: symbol.h:79
Definition: symbol.h:83
OutputStatement()
Constructor used to show number of active digits.
Definition: output.cpp:38
Symbol symbol
Definition: token.h:53
char * GetText() const
Definition: token.cpp:84
Definition: symbol.h:91
PromptStatement(char *prompt)
Definition: prompt.cpp:34
A syntax node able to list all user defined functions.
Definition: funclist.h:39
AssignmentNode(VariableNode *variable, ExpressionNode *expression)
Definition: operators.cpp:572
An empty statement.
Definition: empty.h:42
Definition: symbol.h:98
SyntaxNode * ParseListStatement()
Definition: parser.cpp:611
int GetPos() const
Definition: token.cpp:89
Load or save preferences.
Definition: prefs.h:40
ExpressionNode * ParseUnary()
Definition: parser.cpp:344
Definition: symbol.h:85
ExpressionNode * ParseIdent()
Definition: parser.cpp:416
HelpStatement(Symbol argument)
Definition: help.cpp:44
VariableNode(Variable *variable)
Definition: values.cpp:293
Token * GetLastToken() const
Definition: token.cpp:68
ExpressionNode * ParseNumber()
Definition: parser.cpp:469
SyntaxNode * ParseDigistStatement()
Definition: parser.cpp:713
Variable * CreateVariable(const char *name)
class FunctionList * Functions
Definition: program.h:78
#define HELPVARNDEF
Definition: text.h:80
Change numeral input system.
Definition: input.h:39
Definition: symbol.h:48
Definition: symbol.h:67
Variable * CreateVariable(const char *name)
Definition: values.cpp:172
AdditionNode(ExpressionNode *left, ExpressionNode *right)
Definition: operators.cpp:431
Token * GetFirstToken() const
Definition: lexer.cpp:62
virtual Number * Parse(const char *text)
Definition: ntext.cpp:44
Definition: symbol.h:99
Lexer(const char *input)
Definition: lexer.cpp:38
UnaryNode(ExpressionNode *expression)
Definition: operators.cpp:39
FunctionNode * GetFunctionCall(const char *function, ExpressionNode *value) const
Token * GetNextToken()
Definition: token.cpp:73
Parser(const char *input)
Definition: parser.cpp:43
void SetExpression(ExpressionNode *expression)
SyntaxNode * ParseHelpStatement()
Definition: parser.cpp:566
#define HELPFUNNDEF
Definition: text.h:81
virtual double GetRealValue()=0
Set prompt string.
Definition: prompt.h:40
Exit program.
Definition: exit.h:39
A syntax node able to define a user defined function.
Definition: funcdef.h:39
ExitStatement()
Definition: exit.cpp:33
Change numeral output system.
Definition: output.h:39
#define HELPPNUMERA
Definition: text.h:83
DrawStatement(const char *name, const char *parameter)
Definition: draw.cpp:34
Show version string.
Definition: version.h:39
#define HELPFUNRDEF
Definition: text.h:82
ExpressionNode * ParseAtomic()
Definition: parser.cpp:362
Statement to list all user defined variables.
Definition: values.h:99
Definition: symbol.h:81
ExpressionNode * ParseFactor()
Definition: parser.cpp:306
DigitsStatement(unsigned int digits)
Constructor used to show number of active digits.
Definition: digits.cpp:53
ErrorNode(const char *input, int pos)
Definition: nodes.cpp:147
Definition: symbol.h:78
Show memory usage.
Definition: memory.h:39
Represent a complex number with 2 components of 15 significant digits.
Definition: cplex.h:46
SyntaxNode * ParseDrawStatement()
Definition: parser.cpp:772
SyntaxNode * ParseStatement()
Definition: parser.cpp:156
ShowStatement(const char *file)
Definition: show.cpp:35
Definition: symbol.h:77
Clear the console window.
Definition: clear.h:39
Show license text.
Definition: license.h:39
class VariableList * Variables
Definition: program.h:77
char * GetInput() const
Definition: lexer.cpp:57
ListStatement()
Definition: list.cpp:36
LoadStatement(const char *file)
Definition: load.cpp:36
Represents an error message encapsulated in a syntax tree.
Definition: nodes.h:123
Definition: symbol.h:62
void GetToken()
Definition: parser.cpp:494
Use of a variable in a syntax tree.
Definition: values.h:110
Use of a numeric value in a syntax tree.
Definition: values.h:150
EmptyStatement()
Definition: empty.cpp:32
A user defined function.
Definition: userfunction.h:44
ComplexNumber(double real, double imag)
Definition: cplex.cpp:46
PrefsStatement()
Definition: prefs.cpp:35
Base class for all numeral systems.
Definition: ntext.h:49
void RemoveTemporaryVariable()
Definition: values.cpp:210
ClearStatement()
Definition: clear.cpp:33
HelpStatement()
Definition: help.cpp:37
#define HELPUERROR
Definition: text.h:79
void Tokenize()
Definition: lexer.cpp:67
Definition: symbol.h:94
DeleteStatement(Symbol symbol)
Constructor used to delete either all variable or functions.
Definition: delete.cpp:40
SyntaxNode * ParsePrefsStatement()
Definition: parser.cpp:760
SubtractionNode(ExpressionNode *left, ExpressionNode *right)
Definition: operators.cpp:462
Definition: symbol.h:61
Base class for all nodes related to mathematical expressions.
Definition: nodes.h:99
Mutes the output of another statement.
Definition: silent.h:42
void PutToken()
Definition: parser.cpp:514
DecimalSystem(unsigned int digits)
Definition: ntextd.cpp:66
SyntaxNode * TryParseStatement()
Definition: parser.cpp:124
SyntaxNode * Parse()
Parses the input into a syntax tree.
Definition: parser.cpp:56
OutputStatement(unsigned int base)
Constructor used to set number of active digits.
Definition: output.cpp:47
SyntaxNode * ParseFileStatement()
Definition: parser.cpp:627
static bool IsSystemFunction(const char *name)
class NumeralSystem * Input
Definition: program.h:75
SyntaxNode * ParseNumeralStatement()
Definition: parser.cpp:652
FactorialNode(ExpressionNode *expression)
Definition: operators.cpp:224
Show about text.
Definition: about.h:39
Definition: symbol.h:66
int syntaxError
Definition: parser.h:68
UserFunction * GetFunctionDef(const char *name)
Encapsulates a recursive descent parser.
Definition: parser.h:49
DigitsStatement()
Constructor used to show number of active digits.
Definition: digits.cpp:42
Use of Euler&#39;s number in a syntax tree.
Definition: values.h:174
SaveStatement(const char *file)
Definition: save.cpp:35
SyntaxNode * ParseFunctionDef()
Definition: parser.cpp:535
virtual bool IsSilent()
Definition: nodes.cpp:114
EvalStatement(ExpressionNode *expression)
Definition: eval.cpp:35
DeleteStatement(const char *name)
Constructor used to delete a Variable.
Definition: delete.cpp:52
Use of last result in a syntax tree.
Definition: values.h:135