This class is responsible for handling the references in VTL ($foo). Please look at the Parser.jjt file which is what controls the generation of this class.
상속: NVelocity.Runtime.Parser.Node.SimpleNode
예제 #1
0
 public override object Init(IInternalContextAdapter context, object data)
 {
     base.Init(context, data);
     this.right         = this.RightHandSide;
     this.left          = this.LeftHandSide;
     this.blather       = this.rsvc.GetBoolean("runtime.log.invalid.references", true);
     this.leftReference = this.left.FirstToken.Image.Substring(1);
     return(data);
 }
        /// <summary>
        /// Visitor method - if the literal is right, will
        /// set the literal in the ASTReference node
        /// </summary>
        /// <param name="node">ASTReference to work on</param>
        /// <param name="data">Object to pass down from caller</param>
        public override Object Visit(ASTReference node, Object data)
        {
            // see if there is an override value for this
            // reference
            String overrideVal = (String) argumentMap[node.Literal.Substring(1)];

            // if so, set in the node
            if (overrideVal != null)
                node.SetLiteral(overrideVal);

            // feed the children...
            data = node.ChildrenAccept(this, data);

            return data;
        }
예제 #3
0
	/// <summary>  simple init.  We can get the RHS and LHS as the the tree structure is static
	/// </summary>
	public override System.Object init(InternalContextAdapter context, System.Object data) {
	    /*
	    *  init the tree correctly
	    */

	    base.init(context, data);

	    right = RightHandSide;
	    left = LeftHandSide;

	    blather = rsvc.getBoolean(NVelocity.Runtime.RuntimeConstants_Fields.RUNTIME_LOG_REFERENCE_LOG_INVALID, true);

	    /*
	    *  grab this now.  No need to redo each time
	    */
	    leftReference = left.FirstToken.image.Substring(1);

	    return data;
	}
예제 #4
0
		/// <summary>  simple init.  We can get the RHS and LHS as the the tree structure is static
		/// </summary>
		public override Object Init(IInternalContextAdapter context, Object data)
		{
			/*
	    *  init the tree correctly
	    */

			base.Init(context, data);

			right = RightHandSide;
			left = LeftHandSide;

			blather = runtimeServices.GetBoolean(RuntimeConstants.RUNTIME_LOG_REFERENCE_LOG_INVALID, true);

			/*
	    *  grab this now.  No need to redo each time
	    */
			leftReference = left.FirstToken.Image.Substring(1);

			return data;
		}
예제 #5
0
        /// <summary>  simple init.  We can get the RHS and LHS as the the tree structure is static
        /// </summary>
        public override System.Object init(InternalContextAdapter context, System.Object data)
        {
            /*
             *  init the tree correctly
             */

            base.init(context, data);

            right = RightHandSide;
            left  = LeftHandSide;

            blather = rsvc.getBoolean(NVelocity.Runtime.RuntimeConstants_Fields.RUNTIME_LOG_REFERENCE_LOG_INVALID, true);

            /*
             *  grab this now.  No need to redo each time
             */
            leftReference = left.FirstToken.image.Substring(1);

            return(data);
        }
예제 #6
0
        /// <summary>  simple init.  We can get the RHS and LHS as the the tree structure is static
        /// </summary>
        public override Object Init(IInternalContextAdapter context, Object data)
        {
            /*
             *  init the tree correctly
             */

            base.Init(context, data);

            right = RightHandSide;
            left  = LeftHandSide;

            blather = runtimeServices.GetBoolean(RuntimeConstants.RUNTIME_LOG_REFERENCE_LOG_INVALID, true);

            /*
             *  grab this now.  No need to redo each time
             */
            leftReference = left.FirstToken.Image.Substring(1);

            return(data);
        }
	/// <summary>
	/// Visitor method - if the literal is right, will
	/// set the literal in the ASTReference node
	/// </summary>
	/// <param name="node">ASTReference to work on</param>
	/// <param name="data">Object to pass down from caller</param>
	public override System.Object visit(ASTReference node, System.Object data) {
	    /*
	    *  see if there is an override value for this
	    *  reference
	    */
	    System.String override_Renamed = (System.String) argmap[node.literal().Substring(1)];

	    /*
	    *  if so, set in the node
	    */
	    if (override_Renamed != null) {
		node.Literal = override_Renamed;
	    }

	    /*
	    *  feed the children...
	    */
	    data = node.childrenAccept(this, data);

	    return data;
	}
예제 #8
0
        /// <summary>  simple Init.  We can Get the RHS and LHS as the the tree structure is static</summary>
        /// <param name="context">
        /// </param>
        /// <param name="data">
        /// </param>
        /// <returns> Init result.
        /// </returns>
        public override object Init(IInternalContextAdapter context, object data)
        {
            lock (this)
            {
                /** This method is synchronized to prevent double initialization or initialization while rendering **/

                if (!isInitialized)
                {
                    /*
                     *  Init the tree correctly
                     */

                    base.Init(context, data);

                    uberInfo = new Info(TemplateName, Line, Column);

                    right = RightHandSide;
                    left  = LeftHandSide;

                    logOnNull = rsvc.GetBoolean(NVelocity.Runtime.RuntimeConstants.RUNTIME_LOG_REFERENCE_LOG_INVALID, true);
                    allowNull = rsvc.GetBoolean(NVelocity.Runtime.RuntimeConstants.SET_NULL_ALLOWED, false);
                    strictRef = rsvc.GetBoolean(NVelocity.Runtime.RuntimeConstants.RUNTIME_REFERENCES_STRICT, false);
                    if (strictRef)
                    {
                        allowNull = true; // strictRef implies allowNull
                    }

                    /*
                     *  grab this now.  No need to redo each time
                     */
                    leftReference = left.FirstToken.Image.Substring(1);

                    isInitialized = true;
                }

                return(data);
            }
        }
예제 #9
0
		public virtual Object Visit(ASTReference node, Object data)
		{
			data = node.ChildrenAccept(this, data);
			return data;
		}
예제 #10
0
		/// <summary>Display an ASTReference node
		/// </summary>
		public override Object Visit(ASTReference node, Object data)
		{
			return ShowNode(node, data);
		}
예제 #11
0
	public void  Reference() {
	    /*@bgen(jjtree) Reference */
	    ASTReference jjtn000 = new ASTReference(this, ParserTreeConstants.JJTREFERENCE);
	    bool jjtc000 = true;
	    jjtree.openNodeScope(jjtn000);
	    //UPGRADE_NOTE: Exception 'java.lang.Throwable' was converted to ' ' which has different behavior. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1100"'
	    try {
		switch ((jj_ntk_Renamed_Field == - 1)?jj_ntk():jj_ntk_Renamed_Field) {
		    case ParserConstants.IDENTIFIER:
			jj_consume_token(ParserConstants.IDENTIFIER);
			while (true) {
			    if (jj_2_5(2)) {
				;
			    } else {
				//UPGRADE_NOTE: Labeled break statement was changed to a goto statement. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1012"'
				goto label_7_brk;
			    }
			    jj_consume_token(ParserConstants.DOT);
			    if (jj_2_6(3)) {
				Method();
			    } else {
				switch ((jj_ntk_Renamed_Field == - 1)?jj_ntk():jj_ntk_Renamed_Field) {
				    case ParserConstants.IDENTIFIER:
					Identifier();
					break;

				    default:
					jj_la1[23] = jj_gen;
					jj_consume_token(- 1);
					throw new ParseException();

				}
			    }
			}
			//UPGRADE_NOTE: Label 'label_7_brk' was added. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1011"'
label_7_brk:
			;

			break;

		    case ParserConstants.LCURLY:
			jj_consume_token(ParserConstants.LCURLY);
			jj_consume_token(ParserConstants.IDENTIFIER);
			while (true) {
			    if (jj_2_7(2)) {
				;
			    } else {
				//UPGRADE_NOTE: Labeled break statement was changed to a goto statement. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1012"'
				goto label_8_brk;
			    }
			    jj_consume_token(ParserConstants.DOT);
			    if (jj_2_8(3)) {
				Method();
			    } else {
				switch ((jj_ntk_Renamed_Field == - 1)?jj_ntk():jj_ntk_Renamed_Field) {
				    case ParserConstants.IDENTIFIER:
					Identifier();
					break;

				    default:
					jj_la1[24] = jj_gen;
					jj_consume_token(- 1);
					throw new ParseException();

				}
			    }
			}
			//UPGRADE_NOTE: Label 'label_8_brk' was added. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1011"'
label_8_brk:
			;

			jj_consume_token(ParserConstants.RCURLY);
			break;

		    default:
			jj_la1[25] = jj_gen;
			jj_consume_token(- 1);
			throw new ParseException();

		}
	    } catch (System.Exception jjte000) {
		if (jjtc000) {
		    jjtree.clearNodeScope(jjtn000);
		    jjtc000 = false;
		} else {
		    jjtree.popNode();
		}
		if (jjte000 is System.SystemException) { {
			if (true)
			    throw (System.SystemException) jjte000;
		    }
		}
		if (jjte000 is ParseException) { {
			if (true)
			    throw (ParseException) jjte000;
		    }
		} {
		    if (true)
			throw (System.ApplicationException) jjte000;
		}
	    } finally {
		if (jjtc000) {
		    jjtree.closeNodeScope(jjtn000, true);
		}
	    }
	}
예제 #12
0
	public virtual System.Object visit(ASTReference node, System.Object data) {
	    data = node.childrenAccept(this, data);
	    return data;
	}
예제 #13
0
 /// <summary>Display an ASTReference node
 /// </summary>
 public override System.Object visit(ASTReference node, System.Object data)
 {
     return showNode(node, data);
 }