Esempio n. 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());
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 3
0
 public override bool Check(Position pos)
 {
     return(Utills.Check(pos, rbracketPr));
 }
Esempio n. 4
0
 public override bool Check(Position pos)
 {
     return(Utills.Check(pos, digitPr));
 }
Esempio n. 5
0
 public override bool Check(Position pos)
 {
     return(!(Utills.Check(pos, notErrorPr)));
 }
Esempio n. 6
0
 public override bool Check(Position pos)
 {
     return(Utills.Check(pos, beginVarPr));
 }
 public override bool Check(Position pos)
 {
     return(Utills.Check(pos, semicolonPr));
 }