Inheritance: FogCreek.Wasabi.AST.CNode
Esempio n. 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;
 }
Esempio n. 3
0
 public CConst(CToken token, CToken name, CExpression exp)
     : base(token)
 {
     constName         = name;
     constValue        = exp;
     constValue.Parent = this;
 }
Esempio n. 4
0
 public CConst(CToken token, CToken name, CExpression exp)
     : base(token)
 {
     constName = name;
     constValue = exp;
     constValue.Parent = this;
 }
Esempio n. 5
0
 public void Replace(CNode child, CNode newchild)
 {
     if (child == expression)
     {
         Expression = (CExpression)newchild;
     }
 }
Esempio n. 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;
        }
Esempio n. 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;
 }
Esempio n. 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);
        }
Esempio n. 11
0
 public CIf(CToken token, CExpression condition, bool oneLine, bool elseIf)
     : base(token)
 {
     this.condition = condition;
     condition.Parent = this;
     oneLineFlag = oneLine;
     elseIfFlag = elseIf;
 }
Esempio n. 12
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (child == group)
     {
         group = (CExpression)newchild;
     }
     newchild.Parent = this;
 }
Esempio n. 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);
        }
Esempio n. 15
0
 public CIf(CToken token, CExpression condition, bool oneLine, bool elseIf)
     : base(token)
 {
     this.condition   = condition;
     condition.Parent = this;
     oneLineFlag      = oneLine;
     elseIfFlag       = elseIf;
 }
Esempio n. 16
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (withObj == child)
     {
         withObj         = (CExpression)newchild;
         newchild.Parent = this;
     }
 }
Esempio n. 17
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (withObj == child)
     {
         withObj = (CExpression)newchild;
         newchild.Parent = this;
     }
 }
Esempio n. 18
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (child == condition)
     {
         condition = (CExpression)newchild;
     }
     newchild.Parent = this;
 }
Esempio n. 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;
 }
Esempio n. 21
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (lhs == child)
         lhs = (CExpression)newchild;
     if (rhs == child)
         rhs = (CExpression)newchild;
     newchild.Parent = this;
 }
Esempio n. 22
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (child == pivot)
     {
         pivot = (CExpression)newchild;
     }
     newchild.Parent = this;
 }
Esempio n. 23
0
 public CBinaryOperator(CToken tok, CExpression lhs, CExpression rhs)
     : base(tok)
 {
     operation = tok;
     this.lhs = lhs;
     this.rhs = rhs;
     lhs.Parent = this;
     rhs.Parent = this;
 }
Esempio n. 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;
 }
Esempio n. 25
0
 public CBinaryOperator(CToken tok, CExpression lhs, CExpression rhs)
     : base(tok)
 {
     operation  = tok;
     this.lhs   = lhs;
     this.rhs   = rhs;
     lhs.Parent = this;
     rhs.Parent = this;
 }
Esempio n. 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;
 }
Esempio n. 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;
        }
Esempio n. 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;
 }
Esempio n. 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;
        }
Esempio n. 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;
 }
Esempio n. 31
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (lhs == child)
     {
         lhs = (CExpression)newchild;
     }
     if (rhs == child)
     {
         rhs = (CExpression)newchild;
     }
     newchild.Parent = this;
 }
Esempio n. 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;
 }
Esempio n. 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;
 }
Esempio n. 35
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (child == condition)
         condition = (CExpression)newchild;
     newchild.Parent = this;
 }
Esempio n. 36
0
 public CLogic(CToken tok, CExpression lhs, CExpression rhs)
     : base(tok, lhs, rhs)
 {
 }
Esempio n. 37
0
 public CMathUnary(CToken tok, CExpression rhs)
     : base(tok, rhs)
 {
 }
Esempio n. 38
0
 public CComparison(CToken tok, CExpression lhs, CExpression rhs)
     : base(tok, lhs, rhs)
 {
     base.LoadType(BuiltIns.Boolean);
 }
Esempio n. 39
0
 public CMathUnary(CToken tok, CExpression rhs)
     : base(tok, rhs)
 {
 }
Esempio n. 40
0
 public CConcat(CToken tok, CExpression lhs, CExpression rhs)
     : base(tok, lhs, rhs)
 {
 }
Esempio n. 41
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (child == m_value)
         m_value = (CExpression)newchild;
     newchild.Parent = this;
 }
Esempio n. 42
0
 public void Replace(CNode child, CNode newchild)
 {
     if (child == expression)
         Expression = (CExpression)newchild;
 }
Esempio n. 43
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (child == group)
         group = (CExpression)newchild;
     newchild.Parent = this;
 }
Esempio n. 44
0
 public CMath(CToken tok, CExpression lhs, CExpression rhs)
     : base(tok, lhs, rhs)
 {
 }
Esempio n. 45
0
 internal void VisitExpression(CExpression exp)
 {
     exp.Accept(visitor);
 }
Esempio n. 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;
 }
Esempio n. 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;
 }
Esempio n. 50
0
 public CNot(CToken tok, CExpression rhs)
     : base(tok, rhs)
 {
     base.LoadType(BuiltIns.Boolean);
 }
Esempio n. 51
0
 public CCast(CTypeRef type, CExpression exp)
     : base(type.TypeName, exp)
 {
     LoadType(type);
 }
Esempio n. 52
0
 public CWith(CToken token, CExpression value)
     : base(token)
 {
     withObj      = value;
     value.Parent = this;
 }
Esempio n. 53
0
 public CConcat(CToken tok, CExpression lhs, CExpression rhs)
     : base(tok, lhs, rhs)
 {
 }
Esempio n. 54
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (child == pivot)
         pivot = (CExpression)newchild;
     newchild.Parent = this;
 }
Esempio n. 55
0
 public CLock(CToken token, CExpression value)
     : base(token)
 {
     lockObj = value;
     value.Parent = this;
 }