示例#1
0
        public override void Visit(IRBracketToken t)
        {
            // Get operators of subexpression
            List <IToken> subExpOperators = Utills.MoveUntil(m_operators, m_lbracketPr);

            // Add operators to the result(RPN) list
            m_resultTokens.AddRange(subExpOperators);

            // Remove left bracket
            m_operators.Pop();

            // Function check
            if (m_operators.Count != 0 && Utills.Check(m_operators, m_funcNamePr))
            {
                m_resultTokens.Add(m_operators.Pop());
            }
        }
示例#2
0
        private bool CheckUnaryOp(Position pos)
        {
            Position prevPos = pos - 1;

            // If <UnaryOp> is a first character
            if (prevPos.IsBegin)
            {
                return(true);
            }

            // If <UnaryOp> located after the left bracket ')'
            if (Utills.Check(pos - 1, lbracketPr) &&
                Tables.UnaryOperatorsPriorityTable.ContainsKey(pos.Current))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#3
0
 public override bool Check(Position pos)
 {
     return(Utills.Check(pos, rbracketPr));
 }
示例#4
0
 public override bool Check(Position pos)
 {
     return(Utills.Check(pos, digitPr));
 }
示例#5
0
 public override bool Check(Position pos)
 {
     return(!(Utills.Check(pos, notErrorPr)));
 }
示例#6
0
 public override bool Check(Position pos)
 {
     return(Utills.Check(pos, beginVarPr));
 }
 public override bool Check(Position pos)
 {
     return(Utills.Check(pos, semicolonPr));
 }