Example #1
0
 public ExpressionContext(Parse.Expression expression, Type.BaseType type, Characteristic characteristics, Action<MethodContext> emitGet)
 {
     Expression = expression;
     Type = type;
     Characteristics = characteristics;
     EmitGet = emitGet;
 }
Example #2
0
 internal Var(Lexeme name, Parse.Expression expr)
 {
     if (!(name.ToString().All(c => char.IsLetterOrDigit(c) || c == '_')))
     {
         throw new Exception("Variable {name.ToString()} has an invalid name");
     }
     this.name            = name;
     this.exprInitializer = expr;
     this.isInitalizedVar = true;
 }
Example #3
0
 internal If(Parse.Expression condition, Stmt thenBranch, Stmt elseBranch)
 {
     this.condition  = condition;
     this.thenBranch = thenBranch;
     this.elseBranch = elseBranch;
 }
Example #4
0
 internal Expression(Parse.Expression expression)
 {
     this.expression = expression;
 }
Example #5
0
 internal Return(Lexeme keyword, Parse.Expression expression)
 {
     this.keyword = keyword;
     this.expr    = expression;
 }
Example #6
0
 internal While(Parse.Expression condition, Stmt whileBlock)
 {
     this.condition  = condition;
     this.whileBlock = whileBlock;
 }
Example #7
0
 internal Print(Parse.Expression expr)
 {
     this.expr = expr;
 }