public MoveRule(string piece, CoordExpr from, CoordExpr to, bool targetEmpty, string label, Expression condition, Statement action, Game g) { PieceType = piece; From = from; To = to; TargetMustBeEmpty = targetEmpty; Label = label; Condition = condition; this.action = action; }
static CoordExpr() { Expression.RegisterParser("LIT_COORDS", tree => { Expression[] e = new Expression[tree.ChildCount]; for (int i = 0; i < tree.ChildCount; i++) { e[i] = Expression.Parse(tree.GetChild(i)); } return new CoordExpr(e); }); }
static SelectExpr() { Expression.RegisterParser("SELECT", tree => { Expression varName = Expression.Parse(tree.GetChild("REF")); Expression from = Expression.Parse(tree.GetChild("SELECT_FROM").GetOnlyChild()); Expression where = null; if (tree.HasChild("SELECT_WHERE")) { where = Expression.Parse(tree.GetChild("SELECT_WHERE").GetOnlyChild()); } return new SelectExpr(varName, from, where); }); }
public ModExpr(Expression lhs, Expression rhs) { this.lhs = lhs; this.rhs = rhs; }
public ExprStatement(Expression e) { this.e = e; }
public IfStatement(Expression condition, Statement action) { this.condition = condition; this.action = action; }
public RangeExpr(Expression lhs, Expression rhs) { this.lhs = lhs; this.rhs = rhs; }
public void AddRule(Expression exp) { ruleList.Add(exp); }
public ReturnStatement(Expression exp) { this.exp = exp; }
public NotExpr(Expression expr) { this.expr = expr; }
public PlayerRefExpr(Expression playerID) { this.playerID = playerID; }
public MemberAccessExpr(Expression parent, Expression member) { this.parent = parent; this.member = member; }
public SelectExpr(Expression varName, Expression from, Expression where = null) { this.varName = varName; this.from = from; this.where = where; }
public FunctionCallExpr(Expression name, params Expression[] p) { this.name = name; this.p = (Expression[])p.Clone(); }
public AssignmentStatement(Expression variable, Expression value) { this.variable = variable; this.value = value; }