private bool elseCaseFlag; // flag indicating if this case is the default case // if statements is null, that means there are no statements. meaning this case uses the statements // of the case below it. so dont put a break point. eg: // switch (color) { // case (red): // case (blue): // print("its red or blue); // break; // public CCase(CToken token, CExpression val) : base(token) { m_value = val; m_value.Parent = this; statements = null; }
public CUnaryOperator(CToken tok, CExpression rhs) : base(tok) { action = tok; this.rhs = rhs; rhs.Parent = this; }
public CConst(CToken token, CToken name, CExpression exp) : base(token) { constName = name; constValue = exp; constValue.Parent = this; }
public void Replace(CNode child, CNode newchild) { if (child == expression) { Expression = (CExpression)newchild; } }
private CStatementBlock cases; // this will be a vector of case objects public CSelect(CToken token, CExpression pivot) : base(token) { cases = new CStatementBlock(); this.pivot = pivot; pivot.Parent = this; }
private CStatementBlock statements; // the statements to be executed in this case of the switch #endregion Fields #region Constructors // if statements is null, that means there are no statements. meaning this case uses the statements // of the case below it. so dont put a break point. eg: // switch (color) { // case (red): // case (blue): // print("its red or blue); // break; // public CCase(CToken token, CExpression val) : base(token) { m_value = val; m_value.Parent = this; statements = null; }
internal void FinishInitialize(CExpression cExpression) { CReturn @return = new CReturn(Token); @return.Expression = cExpression; lambdaFunction.Statements.Add(@return); }
public CIf(CToken token, CExpression condition, bool oneLine, bool elseIf) : base(token) { this.condition = condition; condition.Parent = this; oneLineFlag = oneLine; elseIfFlag = elseIf; }
void INodeParent.Replace(CNode child, CNode newchild) { if (child == group) { group = (CExpression)newchild; } newchild.Parent = this; }
void INodeParent.Replace(CNode child, CNode newchild) { if (child == m_value) { m_value = (CExpression)newchild; } newchild.Parent = this; }
void INodeParent.Replace(CNode child, CNode newchild) { if (withObj == child) { withObj = (CExpression)newchild; newchild.Parent = this; } }
void INodeParent.Replace(CNode child, CNode newchild) { if (child == condition) { condition = (CExpression)newchild; } newchild.Parent = this; }
void INodeParent.Replace(CNode child, CNode newchild) { if (child == expr) { expr = (CExpression)newchild; } newchild.Parent = this; }
void INodeParent.Replace(CNode child, CNode newchild) { if (inner == child) { inner = (CExpression)newchild; } newchild.Parent = this; }
void INodeParent.Replace(CNode child, CNode newchild) { if (lhs == child) lhs = (CExpression)newchild; if (rhs == child) rhs = (CExpression)newchild; newchild.Parent = this; }
void INodeParent.Replace(CNode child, CNode newchild) { if (child == pivot) { pivot = (CExpression)newchild; } newchild.Parent = this; }
public CBinaryOperator(CToken tok, CExpression lhs, CExpression rhs) : base(tok) { operation = tok; this.lhs = lhs; this.rhs = rhs; lhs.Parent = this; rhs.Parent = this; }
internal void Add(string p, CExpression cExpression) { if (items.Length == count) { Array.Resize(ref items, items.Length * 2); } items[count++] = new KeyValuePair <string, CNode>(p, cExpression); cExpression.Parent = parent; }
// this is the constructor when you actually need to parse all the statements of a case // until you hit the next case public CCase(CToken token, CExpression val, CStatementBlock block) : base(token) { m_value = val; elseCaseFlag = val == null; if (!elseCaseFlag) m_value.Parent = this; statements = block; }
public CTernary(CToken tok, CExpression cond, CExpression lhs, CExpression rhs) : base(tok) { this.cond = cond; this.lhs = lhs; this.rhs = rhs; cond.Parent = this; lhs.Parent = this; rhs.Parent = this; }
// this is the constructor when you actually need to parse all the statements of a case // until you hit the next case public CCase(CToken token, CExpression val, CStatementBlock block) : base(token) { m_value = val; elseCaseFlag = val == null; if (!elseCaseFlag) { m_value.Parent = this; } statements = block; }
public CVariable(CToken name, bool shared, CTypeRef tref, CParameters arrayDimsinit, CExpression init, CDim parent) : base(name, shared) { this.dim = parent; this.name = name; base.LoadType(tref); this.init = init; if (init != null) init.Parent = this; member = false; this.arrayDimsinit = arrayDimsinit; }
void INodeParent.Replace(CNode child, CNode newchild) { if (lhs == child) { lhs = (CExpression)newchild; } if (rhs == child) { rhs = (CExpression)newchild; } newchild.Parent = this; }
public CVariable(CToken name, bool shared, CTypeRef tref, CParameters arrayDimsinit, CExpression init, CDim parent) : base(name, shared) { this.dim = parent; this.name = name; base.LoadType(tref); this.init = init; if (init != null) { init.Parent = this; } member = false; this.arrayDimsinit = arrayDimsinit; }
public CSpecialEqual(CToken token, CExpression value) : base(token) { expr = value; expr.Parent = this; }
public CParenExpression(CToken tok, CExpression inner) : base(tok) { this.inner = inner; inner.Parent = this; }
void INodeParent.Replace(CNode child, CNode newchild) { if (child == condition) condition = (CExpression)newchild; newchild.Parent = this; }
public CLogic(CToken tok, CExpression lhs, CExpression rhs) : base(tok, lhs, rhs) { }
public CMathUnary(CToken tok, CExpression rhs) : base(tok, rhs) { }
public CComparison(CToken tok, CExpression lhs, CExpression rhs) : base(tok, lhs, rhs) { base.LoadType(BuiltIns.Boolean); }
public CConcat(CToken tok, CExpression lhs, CExpression rhs) : base(tok, lhs, rhs) { }
void INodeParent.Replace(CNode child, CNode newchild) { if (child == m_value) m_value = (CExpression)newchild; newchild.Parent = this; }
public void Replace(CNode child, CNode newchild) { if (child == expression) Expression = (CExpression)newchild; }
void INodeParent.Replace(CNode child, CNode newchild) { if (child == group) group = (CExpression)newchild; newchild.Parent = this; }
public CMath(CToken tok, CExpression lhs, CExpression rhs) : base(tok, lhs, rhs) { }
internal void VisitExpression(CExpression exp) { exp.Accept(visitor); }
void INodeParent.Replace(CNode child, CNode newchild) { if (inner == child) inner = (CExpression)newchild; newchild.Parent = this; }
public CWith(CToken token, CExpression value) : base(token) { withObj = value; value.Parent = this; }
public CNot(CToken tok, CExpression rhs) : base(tok, rhs) { base.LoadType(BuiltIns.Boolean); }
public CCast(CTypeRef type, CExpression exp) : base(type.TypeName, exp) { LoadType(type); }
void INodeParent.Replace(CNode child, CNode newchild) { if (child == pivot) pivot = (CExpression)newchild; newchild.Parent = this; }
public CLock(CToken token, CExpression value) : base(token) { lockObj = value; value.Parent = this; }