コード例 #1
0
 private void State_34()
 {
     if (ActionStack.Last() != ActionStack.WrongLexem)
     {
         Action returnState = ActionStack.Pop();
         returnState();
     }
 }
コード例 #2
0
 private void State_29()
 {
     if (CurrentLexemValue() == "next")
     {
         Action returnState = ActionStack.Pop();
         lexemsIterator++;
         returnState();
     }
     else
     {
         throw new LexemException(CurrentLineNumber(), "Missed next");
     }
 }
コード例 #3
0
 private void State_53()
 {
     if (CurrentLexemValue() == "or" || CurrentLexemValue() == "and")
     {
         CurrentState = 51;
         lexemsIterator++;
         State_51();
     }
     else
     {
         Action returnState = ActionStack.Pop();
         returnState();
     }
 }
コード例 #4
0
 private void State_33()
 {
     if (CurrentLexemValue() == "}")
     {
         Action returnState = ActionStack.Pop();
         lexemsIterator++;
         returnState();
     }
     else
     {
         ActionStack.Push(State_32);
         HalfAutomatOperator();
     }
 }
コード例 #5
0
        private void State_42()
        {
            HashSet <string> operators = new HashSet <string>()
            {
                "+", "-", "*", "/", "^"
            };

            if (operators.Contains(CurrentLexemValue()))
            {
                CurrentState = 41;
                lexemsIterator++;
                State_41();
            }
            else
            {
                Action returnState = ActionStack.Pop();
                returnState();
            }
        }
コード例 #6
0
 private void State_16()
 {
     if (CurrentLexemValue() == ",")
     {
         CurrentState = 15;
         lexemsIterator++;
         State_15();
     }
     else if (CurrentLexemValue() == ")")
     {
         Action returnState = ActionStack.Pop();
         lexemsIterator++;
         returnState();
     }
     else
     {
         throw new LexemException(CurrentLineNumber(), "Missed ) or ,");
     }
 }