Inheritance: FogCreek.Wasabi.AST.CNode
Ejemplo 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;
        }
Ejemplo n.º 2
0
 public CUnaryOperator(CToken tok, CExpression rhs)
     : base(tok)
 {
     action = tok;
     this.rhs = rhs;
     rhs.Parent = this;
 }
Ejemplo n.º 3
0
 public CConst(CToken token, CToken name, CExpression exp)
     : base(token)
 {
     constName         = name;
     constValue        = exp;
     constValue.Parent = this;
 }
Ejemplo n.º 4
0
 public CConst(CToken token, CToken name, CExpression exp)
     : base(token)
 {
     constName = name;
     constValue = exp;
     constValue.Parent = this;
 }
Ejemplo n.º 5
0
 public void Replace(CNode child, CNode newchild)
 {
     if (child == expression)
     {
         Expression = (CExpression)newchild;
     }
 }
Ejemplo 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;
        }
Ejemplo 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;
        }
Ejemplo n.º 8
0
 public CUnaryOperator(CToken tok, CExpression rhs)
     : base(tok)
 {
     action     = tok;
     this.rhs   = rhs;
     rhs.Parent = this;
 }
Ejemplo 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;
        }
Ejemplo n.º 10
0
        internal void FinishInitialize(CExpression cExpression)
        {
            CReturn @return = new CReturn(Token);
            @return.Expression = cExpression;

            lambdaFunction.Statements.Add(@return);
        }
Ejemplo 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;
 }
Ejemplo n.º 12
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (child == group)
     {
         group = (CExpression)newchild;
     }
     newchild.Parent = this;
 }
Ejemplo n.º 13
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (child == m_value)
     {
         m_value = (CExpression)newchild;
     }
     newchild.Parent = this;
 }
Ejemplo n.º 14
0
        internal void FinishInitialize(CExpression cExpression)
        {
            CReturn @return = new CReturn(Token);

            @return.Expression = cExpression;

            lambdaFunction.Statements.Add(@return);
        }
Ejemplo 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;
 }
Ejemplo n.º 16
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (withObj == child)
     {
         withObj         = (CExpression)newchild;
         newchild.Parent = this;
     }
 }
Ejemplo n.º 17
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (withObj == child)
     {
         withObj = (CExpression)newchild;
         newchild.Parent = this;
     }
 }
Ejemplo n.º 18
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (child == condition)
     {
         condition = (CExpression)newchild;
     }
     newchild.Parent = this;
 }
Ejemplo n.º 19
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (child == expr)
     {
         expr = (CExpression)newchild;
     }
     newchild.Parent = this;
 }
Ejemplo n.º 20
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (inner == child)
     {
         inner = (CExpression)newchild;
     }
     newchild.Parent = this;
 }
Ejemplo 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;
 }
Ejemplo n.º 22
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (child == pivot)
     {
         pivot = (CExpression)newchild;
     }
     newchild.Parent = this;
 }
Ejemplo 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;
 }
Ejemplo 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;
 }
Ejemplo 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;
 }
Ejemplo 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;
 }
Ejemplo 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;
        }
Ejemplo 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;
 }
Ejemplo 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;
        }
Ejemplo 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;
 }
Ejemplo 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;
 }
Ejemplo 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;
 }
Ejemplo n.º 33
0
 public CSpecialEqual(CToken token, CExpression value)
     : base(token)
 {
     expr        = value;
     expr.Parent = this;
 }
Ejemplo n.º 34
0
 public CParenExpression(CToken tok, CExpression inner)
     : base(tok)
 {
     this.inner = inner;
     inner.Parent = this;
 }
Ejemplo n.º 35
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (child == condition)
         condition = (CExpression)newchild;
     newchild.Parent = this;
 }
Ejemplo n.º 36
0
 public CLogic(CToken tok, CExpression lhs, CExpression rhs)
     : base(tok, lhs, rhs)
 {
 }
Ejemplo n.º 37
0
 public CMathUnary(CToken tok, CExpression rhs)
     : base(tok, rhs)
 {
 }
Ejemplo n.º 38
0
 public CComparison(CToken tok, CExpression lhs, CExpression rhs)
     : base(tok, lhs, rhs)
 {
     base.LoadType(BuiltIns.Boolean);
 }
Ejemplo n.º 39
0
 public CMathUnary(CToken tok, CExpression rhs)
     : base(tok, rhs)
 {
 }
Ejemplo n.º 40
0
 public CConcat(CToken tok, CExpression lhs, CExpression rhs)
     : base(tok, lhs, rhs)
 {
 }
Ejemplo n.º 41
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (child == m_value)
         m_value = (CExpression)newchild;
     newchild.Parent = this;
 }
Ejemplo n.º 42
0
 public void Replace(CNode child, CNode newchild)
 {
     if (child == expression)
         Expression = (CExpression)newchild;
 }
Ejemplo n.º 43
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (child == group)
         group = (CExpression)newchild;
     newchild.Parent = this;
 }
Ejemplo n.º 44
0
 public CMath(CToken tok, CExpression lhs, CExpression rhs)
     : base(tok, lhs, rhs)
 {
 }
Ejemplo n.º 45
0
 internal void VisitExpression(CExpression exp)
 {
     exp.Accept(visitor);
 }
Ejemplo n.º 46
0
 public CSpecialEqual(CToken token, CExpression value)
     : base(token)
 {
     expr = value;
     expr.Parent = this;
 }
Ejemplo n.º 47
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (inner == child)
         inner = (CExpression)newchild;
     newchild.Parent = this;
 }
Ejemplo n.º 48
0
 public CWith(CToken token, CExpression value)
     : base(token)
 {
     withObj = value;
     value.Parent = this;
 }
Ejemplo n.º 49
0
 public CParenExpression(CToken tok, CExpression inner)
     : base(tok)
 {
     this.inner   = inner;
     inner.Parent = this;
 }
Ejemplo n.º 50
0
 public CNot(CToken tok, CExpression rhs)
     : base(tok, rhs)
 {
     base.LoadType(BuiltIns.Boolean);
 }
Ejemplo n.º 51
0
 public CCast(CTypeRef type, CExpression exp)
     : base(type.TypeName, exp)
 {
     LoadType(type);
 }
Ejemplo n.º 52
0
 public CWith(CToken token, CExpression value)
     : base(token)
 {
     withObj      = value;
     value.Parent = this;
 }
Ejemplo n.º 53
0
 public CConcat(CToken tok, CExpression lhs, CExpression rhs)
     : base(tok, lhs, rhs)
 {
 }
Ejemplo n.º 54
0
 void INodeParent.Replace(CNode child, CNode newchild)
 {
     if (child == pivot)
         pivot = (CExpression)newchild;
     newchild.Parent = this;
 }
Ejemplo n.º 55
0
 public CLock(CToken token, CExpression value)
     : base(token)
 {
     lockObj = value;
     value.Parent = this;
 }