Inheritance: FogCreek.Wasabi.AST.CNode
Example #1
0
        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;
 }
Example #3
0
 public CConst(CToken token, CToken name, CExpression exp)
     : base(token)
 {
     constName         = name;
     constValue        = exp;
     constValue.Parent = this;
 }
Example #4
0
 public CConst(CToken token, CToken name, CExpression exp)
     : base(token)
 {
     constName = name;
     constValue = exp;
     constValue.Parent = this;
 }
Example #5
0
 public void Replace(CNode child, CNode newchild)
 {
     if (child == expression)
     {
         Expression = (CExpression)newchild;
     }
 }
Example #6
0
        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;
        }
Example #7
0
        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;
        }
 public CUnaryOperator(CToken tok, CExpression rhs)
     : base(tok)
 {
     action     = tok;
     this.rhs   = rhs;
     rhs.Parent = this;
 }
Example #9
0
        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);
        }
Example #11
0
 public CIf(CToken token, CExpression condition, bool oneLine, bool elseIf)
     : base(token)
 {
     this.condition = condition;
     condition.Parent = this;
     oneLineFlag = oneLine;
     elseIfFlag = elseIf;
 }
Example #12
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (child == group)
     {
         group = (CExpression)newchild;
     }
     newchild.Parent = this;
 }
Example #13
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (child == m_value)
     {
         m_value = (CExpression)newchild;
     }
     newchild.Parent = this;
 }
        internal void FinishInitialize(CExpression cExpression)
        {
            CReturn @return = new CReturn(Token);

            @return.Expression = cExpression;

            lambdaFunction.Statements.Add(@return);
        }
Example #15
0
 public CIf(CToken token, CExpression condition, bool oneLine, bool elseIf)
     : base(token)
 {
     this.condition   = condition;
     condition.Parent = this;
     oneLineFlag      = oneLine;
     elseIfFlag       = elseIf;
 }
Example #16
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (withObj == child)
     {
         withObj         = (CExpression)newchild;
         newchild.Parent = this;
     }
 }
Example #17
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (withObj == child)
     {
         withObj = (CExpression)newchild;
         newchild.Parent = this;
     }
 }
Example #18
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (child == condition)
     {
         condition = (CExpression)newchild;
     }
     newchild.Parent = this;
 }
Example #19
0
 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;
 }
Example #22
0
 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;
 }
Example #24
0
 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;
 }
 public CBinaryOperator(CToken tok, CExpression lhs, CExpression rhs)
     : base(tok)
 {
     operation  = tok;
     this.lhs   = lhs;
     this.rhs   = rhs;
     lhs.Parent = this;
     rhs.Parent = this;
 }
Example #26
0
 // 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;
 }
Example #27
0
        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;
        }
Example #28
0
 // 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;
 }
Example #29
0
        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;
        }
Example #30
0
 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;
 }
Example #32
0
 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;
 }
Example #33
0
 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;
 }
Example #35
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (child == condition)
         condition = (CExpression)newchild;
     newchild.Parent = this;
 }
Example #36
0
 public CLogic(CToken tok, CExpression lhs, CExpression rhs)
     : base(tok, lhs, rhs)
 {
 }
Example #37
0
 public CMathUnary(CToken tok, CExpression rhs)
     : base(tok, rhs)
 {
 }
Example #38
0
 public CComparison(CToken tok, CExpression lhs, CExpression rhs)
     : base(tok, lhs, rhs)
 {
     base.LoadType(BuiltIns.Boolean);
 }
Example #39
0
 public CMathUnary(CToken tok, CExpression rhs)
     : base(tok, rhs)
 {
 }
Example #40
0
 public CConcat(CToken tok, CExpression lhs, CExpression rhs)
     : base(tok, lhs, rhs)
 {
 }
Example #41
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (child == m_value)
         m_value = (CExpression)newchild;
     newchild.Parent = this;
 }
Example #42
0
 public void Replace(CNode child, CNode newchild)
 {
     if (child == expression)
         Expression = (CExpression)newchild;
 }
Example #43
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (child == group)
         group = (CExpression)newchild;
     newchild.Parent = this;
 }
Example #44
0
 public CMath(CToken tok, CExpression lhs, CExpression rhs)
     : base(tok, lhs, rhs)
 {
 }
 internal void VisitExpression(CExpression exp)
 {
     exp.Accept(visitor);
 }
Example #46
0
 public CSpecialEqual(CToken token, CExpression value)
     : base(token)
 {
     expr = value;
     expr.Parent = this;
 }
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (inner == child)
         inner = (CExpression)newchild;
     newchild.Parent = this;
 }
Example #48
0
 public CWith(CToken token, CExpression value)
     : base(token)
 {
     withObj = value;
     value.Parent = this;
 }
 public CParenExpression(CToken tok, CExpression inner)
     : base(tok)
 {
     this.inner   = inner;
     inner.Parent = this;
 }
Example #50
0
 public CNot(CToken tok, CExpression rhs)
     : base(tok, rhs)
 {
     base.LoadType(BuiltIns.Boolean);
 }
Example #51
0
 public CCast(CTypeRef type, CExpression exp)
     : base(type.TypeName, exp)
 {
     LoadType(type);
 }
Example #52
0
 public CWith(CToken token, CExpression value)
     : base(token)
 {
     withObj      = value;
     value.Parent = this;
 }
Example #53
0
 public CConcat(CToken tok, CExpression lhs, CExpression rhs)
     : base(tok, lhs, rhs)
 {
 }
Example #54
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (child == pivot)
         pivot = (CExpression)newchild;
     newchild.Parent = this;
 }
Example #55
0
 public CLock(CToken token, CExpression value)
     : base(token)
 {
     lockObj = value;
     value.Parent = this;
 }