예제 #1
0
파일: WoLClass.cs 프로젝트: Mexahoid/CSF
        //Выражение в скобках
        public void WoLExpr(ref string Input, out WoLNode Node)
        {
            Input = Input.Trim();
              Node = null;
              if (Input.Length != 0)
              {
            _WoLAnd(ref Input, out Node);
            if (pars_Err != 0)
              return;
            Input = Input.Trim();

            while ((Input.Length > 0) && (Input[0] == '|'))
            {
              _WoLTakeElements(ref Input, 1);
              if (Input.Length == 0)
              {
            pars_Err = 0;
            return;
              }
              WoLNode SecondNode;
              _WoLOr(ref Input, out SecondNode);
              if (pars_Err != 0)
            return;
              WoLNode FirstNode = Node;

              WoLOperations Op = WoLOperations.OR;
              Node = new WoLOperation(Op, FirstNode, SecondNode);
            }
              }
        }
예제 #2
0
파일: WoLClass.cs 프로젝트: Mexahoid/CSF
 //AND
 void _WoLAnd(ref string Input, out WoLNode Node)
 {
     Input = Input.Trim();
       Node = null;
       if (Input.Length != 0)
       {
     _WoLFact(ref Input, out Node);
     if (pars_Err != 0)
       return;
     while ((Input.Length != 0) && (Input[0] == '&'))
     {
       _WoLTakeElements(ref Input, 1);
       if (Input.Length == 0)
       {
     pars_Err = 6; //Нужен множитель
     return;
       }
       WoLNode SecondNode;
       _WoLFact(ref Input, out SecondNode);
       if (pars_Err != 0)
     return;
       WoLNode FirstNode = Node;
       WoLOperations Op = WoLOperations.AND;
       Node = new WoLOperation(Op, FirstNode, SecondNode);
     }
       }
       else
     pars_Err = 5;  //Нужно слагаемое
 }