|
Functional-lang
0.0
An example functional programming language
|
Let expression. More...
#include <syntax.hpp>
Public Member Functions | |
| LetExpr (GCMain &gc, const TokenPos &pos, const std::vector< BiOpExpr * > &assignments, Expr *body) | |
| Initialize let expression. More... | |
| const std::vector< BiOpExpr * > & | getAssignments () const noexcept |
| const Expr & | getBody () const noexcept |
| virtual void | mark (GCMain &gc) noexcept |
| If not marked mark itself and children. | |
| virtual Expr * | eval (GCMain &gc, Environment &env) noexcept |
| Evaluates expression one time. More... | |
| virtual Expr * | replace (GCMain &gc, const std::string &name, Expr *expr) const noexcept override |
| Replace all identifiers equal to name with expr. More... | |
| virtual std::vector< std::string > | getIdentifiers () const noexcept override |
| virtual bool | equals (const Expr *expr, bool exact=false) const noexcept override |
| Checks if this expression and expr have the same structure, Every expression has the same structure as '_' (it's called ANY after all). More... | |
| virtual std::string | toString () const noexcept override |
| virtual Expr * | optimize (GCMain &gc) noexcept override |
| virtual Expr * | optimize (GCMain &gc, std::vector< Expr * > &exprs) noexcept |
Public Member Functions inherited from Expr | |
| Expr (GCMain &gc, ExprType type, const TokenPos &pos) | |
| std::size_t | getDepth () const noexcept |
| bool | hasLastEval () const noexcept |
| const TokenPos & | getTokenPos () const noexcept |
| ExprType | getExpressionType () const noexcept |
| Expr * | evalWithLookup (GCMain &gc, Environment &env) noexcept |
Public Member Functions inherited from GCObj | |
| GCObj (GCMain &main) noexcept | |
| Initialize as not marked. | |
| virtual bool | isMarked (GCMain &main) const noexcept |
Additional Inherited Members | |
Protected Member Functions inherited from GCObj | |
| virtual void | markSelf (GCMain &main) |
| Marks itself. | |
Protected Attributes inherited from Expr | |
| std::size_t | depth |
| Expr * | lastEval = nullptr |
Let expression.
|
inline |
Initialize let expression.
| gc | |
| assignments | All assignments of the let expression. |
| body | Body of let expression |
|
overridevirtualnoexcept |
Checks if this expression and expr have the same structure, Every expression has the same structure as '_' (it's called ANY after all).
| expr | The expression to compare to this. |
| exact | If true any must equal any and nothing else. Otherwise any is equal to anyting else. |
Reimplemented from Expr.
|
virtualnoexcept |
Evaluates expression one time.
| gc | |
| env | Environment for accessing variables. |
Reimplemented from Expr.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineoverridevirtualnoexcept |
Reimplemented from Expr.
Reimplemented from Expr.
|
overridevirtualnoexcept |
Replace all identifiers equal to name with expr.
| gc | |
| name | Identifer name to replace. If name is empty, every identifier will be replaced by AnyExpr(expr_any). |
| expr | The expression to replaces identifiers. |
Reimplemented from Expr.
|
inlineoverridevirtualnoexcept |
Reimplemented from Expr.
1.8.15