Пример #1
0
        public PqlDeclaration(PqlToken designEntity, PqlSynonym synonym)
        {
            DesignEntity = designEntity;
            Synonym      = synonym;

            switch (DesignEntity.Type)
            {
            case PqlTokenType.PROCEDURE:
                DeclarationType = typeof(Procedure);
                break;

            case PqlTokenType.PROG_LINE:
            case PqlTokenType.STMT:
                DeclarationType = typeof(Statement);
                break;

            case PqlTokenType.ASSIGN:
                DeclarationType = typeof(Assign);
                break;

            case PqlTokenType.CALL:
                DeclarationType = typeof(Call);
                break;

            case PqlTokenType.WHILE:
                DeclarationType = typeof(While);
                break;

            case PqlTokenType.IF:
                DeclarationType = typeof(If);
                break;

            case PqlTokenType.VARIABLE:
                DeclarationType = typeof(Variable);
                break;

            case PqlTokenType.CONSTANT:
                DeclarationType = typeof(Constant);
                break;
            }

            Attribute = new Attribute("synonym", Synonym.Name);
        }
Пример #2
0
 public PqlPatternNode(PqlSynonym syn, PqlArgument varRef, PqlExpr expr)
 {
     Synonym = syn;
     VarRef  = varRef;
     Expr    = expr;
 }