diff options
author | Justyna Ilczuk <justyna.ilczuk@gmail.com> | 2012-12-17 12:47:05 +0100 |
---|---|---|
committer | Justyna Ilczuk <justyna.ilczuk@gmail.com> | 2012-12-17 12:47:05 +0100 |
commit | c00e4e3e16539bfccbd321c96134c05ab2b0e07d (patch) | |
tree | f14b83c1cd69f94333078223da78fe52a830dc2a /Sencha-lang/AST/ConstantExpression.h | |
parent | b9d9788da24cea3d0e193ac318d07f6c8e1b54ab (diff) | |
download | sencha-lang-c00e4e3e16539bfccbd321c96134c05ab2b0e07d.tar.gz sencha-lang-c00e4e3e16539bfccbd321c96134c05ab2b0e07d.tar.bz2 sencha-lang-c00e4e3e16539bfccbd321c96134c05ab2b0e07d.tar.xz sencha-lang-c00e4e3e16539bfccbd321c96134c05ab2b0e07d.zip |
I was having fun with oxygen trying to do some documentation.
Diffstat (limited to 'Sencha-lang/AST/ConstantExpression.h')
-rw-r--r-- | Sencha-lang/AST/ConstantExpression.h | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/Sencha-lang/AST/ConstantExpression.h b/Sencha-lang/AST/ConstantExpression.h index 3016529..8d9b312 100644 --- a/Sencha-lang/AST/ConstantExpression.h +++ b/Sencha-lang/AST/ConstantExpression.h @@ -11,22 +11,69 @@ #include <iostream> #include "../Context.h" +/** + * ConstantExpression class is used to store complex expression, which are actually + * SenchaObjects. Constant Expressions are made in parser when it encounter some of primitives + * like string literal or numbers, they also can be made on already made SenchaObject. + * ConstantExpression is a part of AST, so it must have parent. It's a node in which it is build. + * It implements four virtual functions: debug, evaluate, execute_quietly. + * It stores the value of expression. + */ class ConstantExpression : public ASTExpression { public: + + /** + * Constructor which sets value to null SenchaObject.o it + * @param parent of the ConstantExpression node + * @param number value will be set to SenchaObject representing this number + */ ConstantExpression(ASTNode * parent); + + + /** + *Constructor which creates SenchaObject(number) and sets value to it + * @param parent of the ConstantExpression node + * @param number value will be set to SenchaObject representing this number + */ ConstantExpression(ASTNode * parent, int number) ; + + /** + * Constructor which creates SenchaObject(number) and sets value to it + * @param parent of the ConstantExpression node + * @param number value will be set to SenchaObject representing this number + */ ConstantExpression(ASTNode * parent, double number) ; + + + /** + * Constructor which creates SenchaObject(text) and sets value to it + * @param parent of the ConstantExpression node + * @param text value will be set to SenchaObject representing this text + */ ConstantExpression(ASTNode * parent, std::string text); + + /** + * Constructor which sets value to given value + * @param parent of the ConstantExpression node + * @param value this->value will be set to value + */ ConstantExpression(ASTNode * parent, SenchaObject value); + /** Here's value of constant expression */ SenchaObject value; - std::string debug(); + /** Provides some useful information */ + std::string debug(); virtual ~ConstantExpression(); + + /**Returns value set in one of constructors */ virtual SenchaObject evaluate(); + /**Prints representation of value */ virtual void execute() ; + + /**Does nothing */ virtual void execute_quietly() ; }; |