示例#1
0
 private void State_27()
 {
     if (CurrentLexemValue() == "\n")
     {
         ActionStack.Push(State_28);
         lexemsIterator++;
         HalfAutomatOperatorsBlock();
     }
     else
     {
         throw new LexemException(CurrentLineNumber(), "Missed ENTER");
     }
 }
示例#2
0
 private void State_26()
 {
     if (CurrentLexemValue() == "step")
     {
         ActionStack.Push(State_27);
         lexemsIterator++;
         HalfAutomatExpression();
     }
     else
     {
         throw new LexemException(CurrentLineNumber(), "Missed step");
     }
 }
示例#3
0
 private void State_33()
 {
     if (CurrentLexemValue() == "}")
     {
         Action returnState = ActionStack.Pop();
         lexemsIterator++;
         returnState();
     }
     else
     {
         ActionStack.Push(State_32);
         HalfAutomatOperator();
     }
 }
示例#4
0
 private void State_31()
 {
     if (CurrentLexemValue() == "{")
     {
         CurrentState = 32;
         lexemsIterator++;
         State_32();
     }
     else
     {
         ActionStack.Push(State_34);
         HalfAutomatOperator();
     }
 }
示例#5
0
 private void State_8()
 {
     if (CurrentLexemValue() == "@end")
     {
         Out.Log(Out.State.LogInfo, "Syntax Analyzer finish success");
         return;
     }
     else
     {
         CurrentState = 11;
         ActionStack.Push(State_7);
         Out.Log(Out.State.LogInfo, "Call half-automat OPERATOR");
         HalfAutomatOperator();
     }
 }
示例#6
0
        private void State_54()
        {
            HashSet <string> operators = new HashSet <string>()
            {
                ">", ">=", "<", "<=", "equ", "!="
            };

            if (operators.Contains(CurrentLexemValue()))
            {
                ActionStack.Push(State_53);
                lexemsIterator++;
                HalfAutomatExpression();
            }
            else
            {
                throw new LexemException(CurrentLineNumber(), "Unknow operator " + CurrentLexemValue());
            }
        }
示例#7
0
 private void State_41()
 {
     if (isCurrentLexemID() || isCurrentLexemCONST())
     {
         CurrentState = 42;
         lexemsIterator++;
         State_42();
     }
     else if (CurrentLexemValue() == "(")
     {
         ActionStack.Push(State_43);
         lexemsIterator++;
         HalfAutomatExpression();
     }
     else
     {
         throw new LexemException(CurrentLineNumber(), "Missed ( or ID or CONST");
     }
 }
示例#8
0
 private void State_51()
 {
     if (CurrentLexemValue() == "!")
     {
         CurrentState = 51;
         lexemsIterator++;
         State_51();
     }
     else if (CurrentLexemValue() == "[")
     {
         ActionStack.Push(State_52);
         lexemsIterator++;
         HalfAutomatLogicalExpression();
     }
     else
     {
         ActionStack.Push(State_54);
         HalfAutomatExpression();
     }
 }