コード例 #1
0
ファイル: RulezParser.g4.cs プロジェクト: boschn/otRulez
        /// <summary>
        /// build a XPT Node for a parameter name
        /// </summary>
        /// <param name="ctx"></param>
        /// <returns></returns>
        public bool BuildXPTNode(VariableNameContext ctx)
        {
            RuleContext root = GetRootContext(ctx, typeof(SelectStatementBlockContext));

            if (root != null)
            {
                if (((SelectStatementBlockContext)root).names.ContainsKey(ctx.GetText()))
                {
                    // set the XPTreeNode to the Symbol
                    ctx.XPTreeNode = ((StatementBlock)((SelectStatementBlockContext)root).XPTreeNode).Variables.Where(x => x.ID == ctx.GetText()).FirstOrDefault();
                }
            }
            this.NotifyErrorListeners(String.Format(Messages.RCM_5, ctx.GetText(), "StatementBlock"));
            return(false);
        }
コード例 #2
0
ファイル: RulezParser.g4.cs プロジェクト: boschn/otRulez
 /// <summary>
 /// build a XPT Node for a parameter name
 /// </summary>
 /// <param name="ctx"></param>
 /// <returns></returns>
 public bool BuildXPTNode(VariableNameContext ctx)
 {
     RuleContext root = GetRootContext(ctx, typeof(SelectStatementBlockContext));
     if (root != null)
     {
         if (((SelectStatementBlockContext)root).names.ContainsKey(ctx.GetText()))
         {
             // set the XPTreeNode to the Symbol
             ctx.XPTreeNode = ((StatementBlock)((SelectStatementBlockContext)root).XPTreeNode).Variables.Where(x => x.ID == ctx.GetText()).FirstOrDefault();
         }
     }
     this.NotifyErrorListeners(String.Format(Messages.RCM_5, ctx.GetText(), "StatementBlock"));
     return false;
 }