Ejemplo n.º 1
0
 public OPRTerm(OPRType oprT)
 {
     base.TermType = TermTypes.OPR; val = new int[1]; val[0] = (int)oprT;
 }
Ejemplo n.º 2
0
            public static OPRTerm GetOperatorTerm(string inpt)
            {
                OPRType tmp = new OPRType();

                switch (inpt)
                {
                case "=":
                    tmp = OPRType.EQUAL;
                    break;

                case "+":
                    tmp = OPRType.PLUS;
                    break;

                case "-":
                    tmp = OPRType.MINUS;
                    break;

                case "*":
                    tmp = OPRType.MULT;
                    break;

                case "/":
                    tmp = OPRType.DIV;
                    break;

                case "<":
                    tmp = OPRType.LESS;
                    break;

                case ">":
                    tmp = OPRType.MORE;
                    break;

                case "!":
                    tmp = OPRType.EXL_MRK;
                    break;

                case "&":
                    tmp = OPRType.AMPERSANT;
                    break;

                case "|":
                    tmp = OPRType.VERT_BAR;
                    break;

                case "==":
                    tmp = OPRType.DBL_EQUAL;
                    break;

                case "+=":
                    tmp = OPRType.PLUS_EQUAL;
                    break;

                case "-=":
                    tmp = OPRType.MINUS_EQUAL;
                    break;

                case "*=":
                    tmp = OPRType.MULT_EQUAL;
                    break;

                case ">=":
                    tmp = OPRType.MORE_EQUAL;
                    break;

                case "<=":
                    tmp = OPRType.LESS_EQUAL;
                    break;

                case "!!":
                    tmp = OPRType.DBL_EXL_MRK;
                    break;

                case "&&":
                    tmp = OPRType.DBL_AMPERSANT;
                    break;

                case "||":
                    tmp = OPRType.DBL_VERT_BAR;
                    break;

                case ">>":
                    tmp = OPRType.RIGHT_SHIFT;
                    break;

                case "<<":
                    tmp = OPRType.LEFT_SHIFT;
                    break;

                case "++":
                    tmp = OPRType.INCREMENT;
                    break;

                case "--":
                    tmp = OPRType.DECREMENT;
                    break;
                }
                return(new OPRTerm(tmp));
            }