Exemplo n.º 1
0
	public override System.Object init(InternalContextAdapter context, System.Object data) {
	    base.init(context, data);

	    /*
	    *  only do things that are not context dependant
	    */

	    if (parser.isDirective(directiveName)) {
		isDirective = true;

		// create a new instance of the directive
		Type t = parser.getDirective(directiveName).GetType();
		Object o = Activator.CreateInstance(t);
		directive = (Directive.Directive) o;

		directive.init(rsvc, context, this);
		directive.setLocation(Line, Column);
	    } else if (rsvc.isVelocimacro(directiveName, context.CurrentTemplateName)) {
		/*
		*  we seem to be a Velocimacro.
		*/

		isDirective = true;
		directive = (Directive.Directive) rsvc.getVelocimacro(directiveName, context.CurrentTemplateName);

		directive.init(rsvc, context, this);
		directive.setLocation(Line, Column);
	    } else {
		isDirective = false;
	    }

	    return data;
	}
Exemplo n.º 2
0
	public override bool evaluate(InternalContextAdapter context) {
	    /*
	    *  get the two args
	    */

	    System.Object left = jjtGetChild(0).value_Renamed(context);
	    System.Object right = jjtGetChild(1).value_Renamed(context);

	    /*
	    *  if either is null, lets log and bail
	    */

	    if (left == null || right == null) {
		rsvc.error((left == null?"Left":"Right") + " side (" + jjtGetChild((left == null?0:1)).literal() + ") of '>=' operation has null value." + " Operation not possible. " + context.CurrentTemplateName + " [line " + Line + ", column " + Column + "]");
		return false;
	    }

	    /*
	    *  if not an Integer, not much we can do either
	    */

	    if (!(left is System.Int32) || !(right is System.Int32)) {
		rsvc.error((!(left is System.Int32)?"Left":"Right") + " side of '>=' operation is not a valid type. " + " It is a " + (!(left is System.Int32)?left.GetType():right.GetType()) + ". Currently only integers (1,2,3...) and Integer type is supported. " + context.CurrentTemplateName + " [line " + Line + ", column " + Column + "]");

		return false;
	    }

	    return ((System.Int32) left) >= ((System.Int32) right);

	}
Exemplo n.º 3
0
	/// <summary> Execute method against context.
	/// </summary>
	public override System.Object execute(System.Object o, InternalContextAdapter context) {
	    if (property == null && method == null)
		return null;

	    try {
		if (property != null) {
		    return property.GetValue(o, null);
		} else {
		    return method.Invoke(o, new Object[0]);
		}
	    } catch (System.Reflection.TargetInvocationException ite) {
		EventCartridge ec = context.EventCartridge;

		/*
		*  if we have an event cartridge, see if it wants to veto
		*  also, let non-Exception Throwables go...
		*/

		if (ec != null && ite.GetBaseException() is System.Exception) {
		    try {
			return ec.methodException(o.GetType(), propertyUsed, (System.Exception) ite.GetBaseException());
		    } catch (System.Exception e) {
			throw new MethodInvocationException("Invocation of property '" + propertyUsed + "'" + " in  " + o.GetType() + " threw exception " + ite.GetBaseException().GetType() + " : " + ite.GetBaseException().Message, ite.GetBaseException(), propertyUsed);
		    }
		} else {
		    /*
		    * no event cartridge to override. Just throw
		    */

		    throw new MethodInvocationException("Invocation of property '" + propertyUsed + "'" + " in  " + o.GetType() + " threw exception " + ite.GetBaseException().GetType() + " : " + ite.GetBaseException().Message, ite.GetBaseException(), propertyUsed);
		}
	    } catch (System.ArgumentException iae) {
		return null;
	    }
	}
Exemplo n.º 4
0
	public override bool evaluate(InternalContextAdapter context) {
	    System.Object left = jjtGetChild(0).value_Renamed(context);
	    System.Object right = jjtGetChild(1).value_Renamed(context);

	    /*
	    *  null check
	    */

	    if (left == null || right == null) {
		rsvc.error((left == null?"Left":"Right") + " side (" + jjtGetChild((left == null?0:1)).literal() + ") of '!=' operation has null value." + " Operation not possible. " + context.CurrentTemplateName + " [line " + Line + ", column " + Column + "]");
		return false;

	    }


	    /*
	    *  check to see if they are the same class.  I don't think this is slower
	    *  as I don't think that getClass() results in object creation, and we can
	    *  extend == to handle all classes
	    */

	    if (left.GetType().Equals(right.GetType())) {
		return !(left.Equals(right));
	    } else {
		rsvc.error("Error in evaluation of != expression." + " Both arguments must be of the same Class." + " Currently left = " + left.GetType() + ", right = " + right.GetType() + ". " + context.CurrentTemplateName + " [line " + Line + ", column " + Column + "] (ASTEQNode)");

		return false;
	    }
	}
Exemplo n.º 5
0
	public override System.Object init(InternalContextAdapter context, System.Object data) {
	    Token t = FirstToken;

	    System.String text = NodeUtils.tokenLiteral(t);

	    ctext = text.ToCharArray();

	    return data;
	}
	/// <summary>  init : we don't have to do much.  Init the tree (there
	/// shouldn't be one) and then see if interpolation is turned on.
	/// </summary>
	public override System.Object init(InternalContextAdapter context, System.Object data) {
	    /*
	    *  simple habit...  we prollie don't have an AST beneath us
	    */

	    base.init(context, data);

	    /*
	    *  the stringlit is set at template parse time, so we can 
	    *  do this here for now.  if things change and we can somehow 
	    * create stringlits at runtime, this must
	    *  move to the runtime execution path
	    *
	    *  so, only if interpolation is turned on AND it starts 
	    *  with a " AND it has a  directive or reference, then we 
	    *  can  interpolate.  Otherwise, don't bother.
	    */

	    interpolate = rsvc.getBoolean(NVelocity.Runtime.RuntimeConstants_Fields.INTERPOLATE_STRINGLITERALS, true) && FirstToken.image.StartsWith("\"") && ((FirstToken.image.IndexOf((System.Char) '$') != - 1) || (FirstToken.image.IndexOf((System.Char) '#') != - 1));

	    /*
	    *  get the contents of the string, minus the '/" at each end
	    */

	    image = FirstToken.image.Substring(1, (FirstToken.image.Length - 1) - (1));

	    /*
	    * tack a space on the end (dreaded <MORE> kludge)
	    */

	    interpolateimage = image + " ";

	    if (interpolate) {
		/*
		*  now parse and init the nodeTree
		*/
		//UPGRADE_ISSUE: The equivalent of constructor 'java.io.BufferedReader.BufferedReader' is incompatible with the expected type in C#. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1109"'
		System.IO.TextReader br = new System.IO.StringReader(interpolateimage);

		/*
		* it's possible to not have an initialization context - or we don't
		* want to trust the caller - so have a fallback value if so
		*
		*  Also, do *not* dump the VM namespace for this template
		*/

		nodeTree = rsvc.parse(br, (context != null)?context.CurrentTemplateName:"StringLiteral", false);

		/*
		*  init with context. It won't modify anything
		*/

		nodeTree.init(context, rsvc);
	    }

	    return data;
	}
Exemplo n.º 7
0
	public override void  init(RuntimeServices rs, InternalContextAdapter context, Node node) {
	    base.init(rs, context, node);

	    /*
	    * again, don't do squat.  We want the AST of the macro 
	    * block to hang off of this but we don't want to 
	    * init it... it's useless...
	    */
	    return ;
	}
Exemplo n.º 8
0
	public override System.Object value_Renamed(InternalContextAdapter context) {
	    int size = jjtGetNumChildren();

	    ArrayList objectArray = new ArrayList();

	    for (int i = 0; i < size; i++) {
		objectArray.Add(jjtGetChild(i).value_Renamed(context));
	    }

	    return objectArray;
	}
	/// <summary>  Initialization method - doesn't do much but do the object
	/// creation.  We only need to do it once.
	/// </summary>
	public override System.Object init(InternalContextAdapter context, System.Object data) {
	    /*
	    *  init the tree correctly
	    */

	    base.init(context, data);

	    value_Renamed_Field = System.Int32.Parse(FirstToken.image);

	    return data;
	}
Exemplo n.º 10
0
	/// <summary>
	/// simple init - init our subtree and get what we can from
	/// the AST
	/// </summary>
	public override System.Object init(InternalContextAdapter context, System.Object data) {
	    base.init(context, data);

	    /*
	    *  this is about all we can do
	    */

	    methodName = FirstToken.image;
	    paramCount = jjtGetNumChildren() - 1;
	    params_Renamed = new System.Object[paramCount];

	    return data;
	}
Exemplo n.º 11
0
	public override bool render(InternalContextAdapter context, System.IO.TextWriter writer) {
	    /*
	    *  normal processing
	    */

	    if (isDirective) {
		directive.render(context, writer, this);
	    } else {
		writer.Write("#");
		writer.Write(directiveName);
	    }

	    return true;
	}
Exemplo n.º 12
0
	/// <summary>   puts the value of the RHS into the context under the key of the LHS
	/// </summary>
	public override bool render(InternalContextAdapter context, System.IO.TextWriter writer) {
	    /*
	    *  get the RHS node, and it's value
	    */

	    System.Object value_Renamed = right.value_Renamed(context);

	    /*
	    * it's an error if we don't have a value of some sort
	    */

	    if (value_Renamed == null) {
		/*
				*  first, are we supposed to say anything anyway?
				*/
		if (blather) {
		    EventCartridge ec = context.EventCartridge;

		    bool doit = true;

		    /*
		    *  if we have an EventCartridge...
		    */
		    if (ec != null) {
			doit = ec.shouldLogOnNullSet(left.literal(), right.literal());
		    }

		    if (doit) {
			rsvc.error("RHS of #set statement is null. Context will not be modified. " + context.CurrentTemplateName + " [line " + Line + ", column " + Column + "]");
		    }
		}

		return false;
	    }

	    /*
	    *  if the LHS is simple, just punch the value into the context
	    *  otherwise, use the setValue() method do to it.
	    *  Maybe we should always use setValue()
	    */

	    if (left.jjtGetNumChildren() == 0) {
		context.Put(leftReference, value_Renamed);
	    } else {
		left.setValue(context, value_Renamed);
	    }

	    return true;
	}
        public NVelocityViewContextAdapter(String componentName,
                                           InternalContextAdapter context, TextWriter writer, INode bodyNode, IDictionary componentParams)
        {
            this.context         = context;
            this.componentName   = componentName;
            this.writer          = writer;
            this.bodyNode        = bodyNode;
            this.componentParams = componentParams;

            // TODO: Implement IEnumerable on NVelocity context
//			foreach(String key in context.Keys)
//			{
//				contextVars[key] = context.Get(key);
//			}
        }
Exemplo n.º 14
0
	/// <summary>
	/// Execute method against context.
	/// </summary>
	public override System.Object execute(System.Object o, InternalContextAdapter context) {
	    if (method == null)
		return null;

	    try {
		return method.Invoke(o, (System.Object[]) args);
	    } catch (System.Reflection.TargetInvocationException ite) {
		/*
		*  the method we invoked threw an exception.
		*  package and pass it up
		*/
		throw new MethodInvocationException("Invocation of method 'get(\"" + args[0] + "\")'" + " in  " + o.GetType() + " threw exception " + ite.GetBaseException().GetType(), ite.GetBaseException(), "get");
	    } catch (System.ArgumentException iae) {
		return null;
	    }
	}
Exemplo n.º 15
0
        private void CheckTemplateStack(InternalContextAdapter context)
        {
            Object[] templateStack = context.TemplateNameStack;

            if (templateStack.Length >= rsvc.getInt(RuntimeConstants_Fields.PARSE_DIRECTIVE_MAXDEPTH, 20))
            {
                StringBuilder path = new StringBuilder();

                for (int i = 0; i < templateStack.Length; ++i)
                {
                    path.Append(" > " + templateStack[i]);
                }

                throw new Exception("Max recursion depth reached (" + templateStack.Length + ")" + " File stack:" + path);
            }
        }
Exemplo n.º 16
0
        private String SetUpEncoding(InternalContextAdapter context)
        {
            Resource current = context.CurrentResource;

            String encoding = null;

            if (current != null)
            {
                encoding = current.Encoding;
            }
            else
            {
                encoding = (String)rsvc.getProperty(RuntimeConstants_Fields.INPUT_ENCODING);
            }
            return(encoding);
        }
Exemplo n.º 17
0
        public override bool render(InternalContextAdapter context, System.IO.TextWriter writer)
        {
            /*
             *  normal processing
             */

            if (isDirective)
            {
                directive.render(context, writer, this);
            }
            else
            {
                writer.Write("#");
                writer.Write(directiveName);
            }

            return(true);
        }
Exemplo n.º 18
0
        /// <summary> Execute method against context.
        /// </summary>
        public override System.Object execute(System.Object o, InternalContextAdapter context)
        {
            if (property == null && method == null)
            {
                return(null);
            }

            try {
                if (property != null)
                {
                    return(property.GetValue(o, null));
                }
                else
                {
                    return(method.Invoke(o, new Object[0]));
                }
            } catch (System.Reflection.TargetInvocationException ite) {
                EventCartridge ec = context.EventCartridge;

                /*
                 *  if we have an event cartridge, see if it wants to veto
                 *  also, let non-Exception Throwables go...
                 */

                if (ec != null && ite.GetBaseException() is System.Exception)
                {
                    try {
                        return(ec.methodException(o.GetType(), propertyUsed, (System.Exception)ite.GetBaseException()));
                    } catch (System.Exception e) {
                        throw new MethodInvocationException("Invocation of property '" + propertyUsed + "'" + " in  " + o.GetType() + " threw exception " + ite.GetBaseException().GetType() + " : " + ite.GetBaseException().Message, ite.GetBaseException(), propertyUsed);
                    }
                }
                else
                {
                    /*
                     * no event cartridge to override. Just throw
                     */

                    throw new MethodInvocationException("Invocation of property '" + propertyUsed + "'" + " in  " + o.GetType() + " threw exception " + ite.GetBaseException().GetType() + " : " + ite.GetBaseException().Message, ite.GetBaseException(), propertyUsed);
                }
            } catch (System.ArgumentException iae) {
                return(null);
            }
        }
Exemplo n.º 19
0
        /// <summary>
        /// Execute method against context.
        /// </summary>
        public override System.Object execute(System.Object o, InternalContextAdapter context)
        {
            if (method == null)
            {
                return(null);
            }

            try {
                return(method.Invoke(o, (System.Object[])args));
            } catch (System.Reflection.TargetInvocationException ite) {
                /*
                 *  the method we invoked threw an exception.
                 *  package and pass it up
                 */
                throw new MethodInvocationException("Invocation of method 'get(\"" + args[0] + "\")'" + " in  " + o.GetType() + " threw exception " + ite.GetBaseException().GetType(), ite.GetBaseException(), "get");
            } catch (System.ArgumentException iae) {
                return(null);
            }
        }
Exemplo n.º 20
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;
	}
Exemplo n.º 21
0
        public override System.Object value_Renamed(InternalContextAdapter context)
        {
            /*
             *  get the two args
             */

            System.Object left  = jjtGetChild(0).value_Renamed(context);
            System.Object right = jjtGetChild(1).value_Renamed(context);

            /*
             *  if either is null, lets log and bail
             */

            if (left == null || right == null)
            {
                rsvc.error((left == null?"Left":"Right") + " side (" + jjtGetChild((left == null?0:1)).literal() + ") of modulus operation has null value." + " Operation not possible. " + context.CurrentTemplateName + " [line " + Line + ", column " + Column + "]");
                return(null);
            }

            /*
             *  if not an Integer, not much we can do either
             */

            if (!(left is System.Int32) || !(right is System.Int32))
            {
                rsvc.error((!(left is System.Int32)?"Left":"Right") + " side of modulus operation is not a valid type. " + "Currently only integers (1,2,3...) and Integer type is supported. " + context.CurrentTemplateName + " [line " + Line + ", column " + Column + "]");

                return(null);
            }

            /*
             *  check for divide by 0
             */

            if (((System.Int32)right) == 0)
            {
                rsvc.error("Right side of modulus operation is zero. Must be non-zero. " + context.CurrentTemplateName + " [line " + Line + ", column " + Column + "]");

                return(null);
            }

            return(((System.Int32)left) % ((System.Int32)right));
        }
Exemplo n.º 22
0
	/// <summary>
	/// does the instrospection of the class for the method needed.
	/// Note, as this calls value() on the args if any, this must
	/// only be called at execute() / render() time.
	///
	/// NOTE: this will try to flip the case of the first character for
	/// convience (compatability with Java version).  If there are no arguments,
	/// it will also try to find a property with the same name (also flipping first character).
	/// </summary>
	private Object doIntrospection(InternalContextAdapter context, System.Type data) {
	    /*
	    *  Now the parameters have to be processed, there
	    *  may be references contained within that need
	    *  to be introspected.
	    */
	    for (int j = 0; j < paramCount; j++) {
		params_Renamed[j] = jjtGetChild(j + 1).value_Renamed(context);
	    }

	    String methodNameUsed = methodName;
	    MethodInfo m = rsvc.Introspector.getMethod(data, methodNameUsed, params_Renamed);
	    PropertyInfo p = null;
	    if (m==null) {
		methodNameUsed = methodName.Substring(0,1).ToUpper() + methodName.Substring(1);
		m = rsvc.Introspector.getMethod(data, methodNameUsed, params_Renamed);
		if (m==null) {
		    methodNameUsed = methodName.Substring(0,1).ToLower() + methodName.Substring(1);
		    m = rsvc.Introspector.getMethod(data, methodNameUsed, params_Renamed);

		    // if there are no arguments, look for a property
		    if (m==null && paramCount==0) {
			methodNameUsed = methodName;
			p = rsvc.Introspector.getProperty(data, methodNameUsed);
			if (p==null) {
			    methodNameUsed = methodName.Substring(0,1).ToUpper() + methodName.Substring(1);
			    p = rsvc.Introspector.getProperty(data, methodNameUsed);
			    if (p==null) {
				methodNameUsed = methodName.Substring(0,1).ToLower() + methodName.Substring(1);
				p = rsvc.Introspector.getProperty(data, methodNameUsed);
			    }
			}
		    }
		}
	    }

	    // if a method was found, return it.  Otherwise, return whatever was found with a property, may be null
	    if (m!= null) {
		return m;
	    } else {
		return p;
	    }
	}
Exemplo n.º 23
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);
        }
Exemplo n.º 24
0
        public virtual System.Object init(InternalContextAdapter context, System.Object data)
        {
            /*
             * hold onto the RuntimeServices
             */

            rsvc = (RuntimeServices)data;

            int i, k = jjtGetNumChildren();

            for (i = 0; i < k; i++)
            {
                try {
                    jjtGetChild(i).init(context, data);
                } catch (ReferenceException re) {
                    rsvc.error(re);
                }
            }

            return(data);
        }
Exemplo n.º 25
0
        /// <summary>  renders the value of the string literal
        /// If the properties allow, and the string literal contains a $ or a #
        /// the literal is rendered against the context
        /// Otherwise, the stringlit is returned.
        /// </summary>
        public override System.Object value_Renamed(InternalContextAdapter context)
        {
            if (interpolate)
            {
                try {
                    /*
                     *  now render against the real context
                     */

                    System.IO.TextWriter writer = new System.IO.StringWriter();
                    nodeTree.render(context, writer);

                    /*
                     * and return the result as a String
                     */

                    System.String ret = writer.ToString();

                    /*
                     *  remove the space from the end (dreaded <MORE> kludge)
                     */

                    return(ret.Substring(0, (ret.Length - 1) - (0)));
                } catch (System.Exception e) {
                    /*
                     *  eh.  If anything wrong, just punt
                     *  and output the literal
                     */
                    rsvc.error("Error in interpolating string literal : " + e);
                }
            }

            /*
             *  ok, either not allowed to interpolate, there wasn't
             *  a ref or directive, or we failed, so
             *  just output the literal
             */

            return(image);
        }
Exemplo n.º 26
0
        public override bool render(InternalContextAdapter context, System.IO.TextWriter writer)
        {
            /*
             * Check if the #if(expression) construct evaluates to true:
             * if so render and leave immediately because there
             * is nothing left to do!
             */
            if (jjtGetChild(0).evaluate(context))
            {
                jjtGetChild(1).render(context, writer);
                return(true);
            }

            int totalNodes = jjtGetNumChildren();

            /*
             * Now check the remaining nodes left in the
             * if construct. The nodes are either elseif
             *  nodes or else nodes. Each of these node
             * types knows how to evaluate themselves. If
             * a node evaluates to true then the node will
             * render itself and this method will return
             * as there is nothing left to do.
             */
            for (int i = 2; i < totalNodes; i++)
            {
                if (jjtGetChild(i).evaluate(context))
                {
                    jjtGetChild(i).render(context, writer);
                    return(true);
                }
            }

            /*
             * This is reached when an ASTIfStatement
             * consists of an if/elseif sequence where
             * none of the nodes evaluate to true.
             */
            return(true);
        }
Exemplo n.º 27
0
        public override void init(RuntimeServices rs, InternalContextAdapter context, INode node)
        {
            base.init(rs, context, node);

            INode compNameNode = node.jjtGetChild(0);

            if (compNameNode == null)
            {
                String message = String.Format("You must specify the component name on the #component directive");
                throw new RailsException(message);
            }

            componentName = compNameNode.FirstToken.image;

            if (componentName == null)
            {
                String message = String.Format("Could not obtain component name from the #component directive");
                throw new RailsException(message);
            }

            component = viewComponentFactory.Create(componentName);
        }
Exemplo n.º 28
0
	public override System.Object value_Renamed(InternalContextAdapter context) {
	    /*
	    *  get the two args
	    */

	    System.Object left = jjtGetChild(0).value_Renamed(context);
	    System.Object right = jjtGetChild(1).value_Renamed(context);

	    /*
	    *  if either is null, lets log and bail
	    */

	    if (left == null || right == null) {
		rsvc.error((left == null?"Left":"Right") + " side (" + jjtGetChild((left == null?0:1)).literal() + ") of modulus operation has null value." + " Operation not possible. " + context.CurrentTemplateName + " [line " + Line + ", column " + Column + "]");
		return null;
	    }

	    /*
	    *  if not an Integer, not much we can do either
	    */

	    if (!(left is System.Int32) || !(right is System.Int32)) {
		rsvc.error((!(left is System.Int32)?"Left":"Right") + " side of modulus operation is not a valid type. " + "Currently only integers (1,2,3...) and Integer type is supported. " + context.CurrentTemplateName + " [line " + Line + ", column " + Column + "]");

		return null;
	    }

	    /*
	    *  check for divide by 0
	    */

	    if (((System.Int32) right) == 0) {
		rsvc.error("Right side of modulus operation is zero. Must be non-zero. " + context.CurrentTemplateName + " [line " + Line + ", column " + Column + "]");

		return null;
	    }

	    return ((System.Int32) left) % ((System.Int32) right);
	}
Exemplo n.º 29
0
        public override System.Object init(InternalContextAdapter context, System.Object data)
        {
            base.init(context, data);

            /*
             *  only do things that are not context dependant
             */

            if (parser.isDirective(directiveName))
            {
                isDirective = true;

                // create a new instance of the directive
                Type   t = parser.getDirective(directiveName).GetType();
                Object o = Activator.CreateInstance(t);
                directive = (Directive.Directive)o;

                directive.init(rsvc, context, this);
                directive.setLocation(Line, Column);
            }
            else if (rsvc.isVelocimacro(directiveName, context.CurrentTemplateName))
            {
                /*
                 *  we seem to be a Velocimacro.
                 */

                isDirective = true;
                directive   = (Directive.Directive)rsvc.getVelocimacro(directiveName, context.CurrentTemplateName);

                directive.init(rsvc, context, this);
                directive.setLocation(Line, Column);
            }
            else
            {
                isDirective = false;
            }

            return(data);
        }
Exemplo n.º 30
0
        /// <summary>   Computes boolean value of this reference
        /// Returns the actual value of reference return type
        /// boolean, and 'true' if value is not null
        /// *
        /// </summary>
        /// <param name="context">context to compute value with
        ///
        /// </param>
        public override bool evaluate(InternalContextAdapter context)
        {
            System.Object value_Renamed = execute(null, context);

            if (value_Renamed == null)
            {
                return(false);
            }
            else if (value_Renamed is System.Boolean)
            {
                if (((System.Boolean)value_Renamed))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(true);
            }
        }
Exemplo n.º 31
0
        private bool RenderView(InternalContextAdapter context,
                                String viewToRender, Template template, TextWriter writer)
        {
            try
            {
                context.PushCurrentTemplateName(viewToRender);
                ((SimpleNode)template.Data).render(context, writer);
            }
            catch (Exception e)
            {
                if (e is MethodInvocationException)
                {
                    throw;
                }

                return(false);
            }
            finally
            {
                context.PopCurrentTemplateName();
            }

            return(true);
        }
Exemplo n.º 32
0
	public override bool render(InternalContextAdapter context, System.IO.TextWriter writer) {
	    /*
	    * Check if the #if(expression) construct evaluates to true:
	    * if so render and leave immediately because there
	    * is nothing left to do!
	    */
	    if (jjtGetChild(0).evaluate(context)) {
		jjtGetChild(1).render(context, writer);
		return true;
	    }

	    int totalNodes = jjtGetNumChildren();

	    /*
	    * Now check the remaining nodes left in the
	    * if construct. The nodes are either elseif
	    *  nodes or else nodes. Each of these node
	    * types knows how to evaluate themselves. If
	    * a node evaluates to true then the node will
	    * render itself and this method will return
	    * as there is nothing left to do.
	    */
	    for (int i = 2; i < totalNodes; i++) {
		if (jjtGetChild(i).evaluate(context)) {
		    jjtGetChild(i).render(context, writer);
		    return true;
		}
	    }

	    /*
	    * This is reached when an ASTIfStatement
	    * consists of an if/elseif sequence where
	    * none of the nodes evaluate to true.
	    */
	    return true;
	}
Exemplo n.º 33
0
	public override bool evaluate(InternalContextAdapter context) {
	    if (jjtGetChild(0).evaluate(context))
		return false;
	    else
		return true;
	}
Exemplo n.º 34
0
	public override System.Object value_Renamed(InternalContextAdapter context) {
	    return value_Renamed_Field;
	}
Exemplo n.º 35
0
	/// <summary>  does the real work.  Creates an Vector of Integers with the
	/// right value range
	/// *
	/// </summary>
	/// <param name="context"> app context used if Left or Right of .. is a ref
	/// </param>
	/// <returns>Object array of Integers
	///
	/// </returns>
	public override System.Object value_Renamed(InternalContextAdapter context) {
	    /*
	    *  get the two range ends
	    */

	    System.Object left = jjtGetChild(0).value_Renamed(context);
	    System.Object right = jjtGetChild(1).value_Renamed(context);

	    /*
	    *  if either is null, lets log and bail
	    */

	    if (left == null || right == null) {
		rsvc.error((left == null?"Left":"Right") + " side of range operator [n..m] has null value." + " Operation not possible. " + context.CurrentTemplateName + " [line " + Line + ", column " + Column + "]");
		return null;
	    }

	    /*
	    *  if not an Integer, not much we can do either
	    */

	    if (!(left is System.Int32) || !(right is System.Int32)) {
		rsvc.error((!(left is System.Int32)?"Left":"Right") + " side of range operator is not a valid type. " + "Currently only integers (1,2,3...) and Integer type is supported. " + context.CurrentTemplateName + " [line " + Line + ", column " + Column + "]");

		return null;
	    }


	    /*
	    *  get the two integer values of the ends of the range
	    */

	    int l = ((System.Int32) left);
	    int r = ((System.Int32) right);

	    /*
	    *  find out how many there are
	    */

	    int num = System.Math.Abs(l - r);
	    num += 1;

	    /*
	    *  see if your increment is Pos or Neg
	    */

	    int delta = (l >= r)?- 1:1;

	    /*
	    *  make the vector and fill it
	    */

	    ArrayList foo = new ArrayList();
	    int val = l;

	    for (int i = 0; i < num; i++) {
		foo.Add(val);
		val += delta;
	    }

	    return foo;
	}
Exemplo n.º 36
0
	/// <summary>  Sets the value of a complex reference (something like $foo.bar)
	/// Currently used by ASTSetReference()
	/// *
	/// </summary>
	/// <seealso cref=" ASTSetDirective
	/// *
	/// "/>
	/// <param name="context">context object containing this reference
	/// </param>
	/// <param name="value">Object to set as value
	/// </param>
	/// <returns>true if successful, false otherwise
	///
	/// </returns>
	public virtual bool setValue(InternalContextAdapter context, System.Object value_Renamed) {
	    /*
	    *  The rootOfIntrospection is the object we will
	    *  retrieve from the Context. This is the base
	    *  object we will apply reflection to.
	    */

	    System.Object result = getVariableValue(context, rootString);

	    if (result == null) {
		rsvc.error(new ReferenceException("reference set : template = " + context.CurrentTemplateName, this));
		return false;
	    }

	    /*
	    * How many child nodes do we have?
	    */

	    for (int i = 0; i < numChildren - 1; i++) {
		result = jjtGetChild(i).execute(result, context);

		if (result == null) {
		    rsvc.error(new ReferenceException("reference set : template = " + context.CurrentTemplateName, this));
		    return false;
		}
	    }

	    /*
	    *  We support two ways of setting the value in a #set($ref.foo = $value ) :
	    *  1) ref.setFoo( value )
	    *  2) ref,put("foo", value ) to parallel the get() map introspection
	    */

	    try {
		/*
				*  first, we introspect for the set<identifier> setter method
				*/

		System.Object[] params_Renamed = new System.Object[]{value_Renamed};

		System.Type c = result.GetType();
		System.Reflection.PropertyInfo p = null;



		try {
		    p = rsvc.Introspector.getProperty(c, identifier);

		    if (p == null) {
			throw new System.MethodAccessException();
		    }
		} catch (System.MethodAccessException nsme2) {
		    System.Text.StringBuilder sb = new System.Text.StringBuilder();
		    sb.Append(identifier);

		    if (System.Char.IsLower(sb[0])) {
			sb[0] = System.Char.ToUpper(sb[0]);
		    } else {
			sb[0] = System.Char.ToLower(sb[0]);
		    }

		    p = rsvc.Introspector.getProperty(c, sb.ToString());

		    if (p == null) {
			throw new System.MethodAccessException();
		    }
		}

		/*
				*  and if we get here, getMethod() didn't chuck an exception...
				*/

		System.Object[] args = new System.Object[]{};
		p.SetValue(result, value_Renamed, args);
	    } catch (System.MethodAccessException nsme) {
		/*
				*  right now, we only support the Map interface
				*/

		if (result is IDictionary) {
		    try {
			IDictionary d = (IDictionary)result;
			d[identifier] = value_Renamed;
		    } catch (System.Exception ex) {
			rsvc.error("ASTReference Map.put : exception : " + ex + " template = " + context.CurrentTemplateName + " [" + this.Line + "," + this.Column + "]");
			return false;
		    }
		} else {
		    rsvc.error("ASTReference : cannot find " + identifier + " as settable property or key to Map in" + " template = " + context.CurrentTemplateName + " [" + this.Line + "," + this.Column + "]");
		    return false;

		}
	    } catch (System.Reflection.TargetInvocationException ite) {
		/*
				*  this is possible 
				*/

		throw new MethodInvocationException("ASTReference : Invocation of method '" + identifier + "' in  " + result.GetType() + " threw exception " + ite.GetBaseException().GetType(), ite.GetBaseException(), identifier);
	    } catch (System.Exception e) {
		/*
				*  maybe a security exception?
				*/
		rsvc.error("ASTReference setValue() : exception : " + e + " template = " + context.CurrentTemplateName + " [" + this.Line + "," + this.Column + "]");
		return false;
	    }

	    return true;
	}
Exemplo n.º 37
0
	/// <summary>   Computes boolean value of this reference
	/// Returns the actual value of reference return type
	/// boolean, and 'true' if value is not null
	/// *
	/// </summary>
	/// <param name="context">context to compute value with
	///
	/// </param>
	public override bool evaluate(InternalContextAdapter context) {
	    System.Object value_Renamed = execute(null, context);

	    if (value_Renamed == null) {
		return false;
	    } else if (value_Renamed is System.Boolean) {
		if (((System.Boolean) value_Renamed))
		    return true;
		else
		    return false;
	    } else
		return true;
	}
Exemplo n.º 38
0
	/// <summary>  Returns the 'root string', the reference key
	/// </summary>

	/// <summary>   gets an Object that 'is' the value of the reference
	/// *
	/// </summary>
	/// <param name="o">  unused Object parameter
	/// </param>
	/// <param name="context">context used to generate value
	///
	/// </param>
	public override System.Object execute(System.Object o, InternalContextAdapter context) {

	    if (referenceType == RUNT)
		return null;

	    /*
	    *  get the root object from the context
	    */

	    System.Object result = getVariableValue(context, rootString);

	    if (result == null) {
		return null;
	    }

	    /*
	    * Iteratively work 'down' (it's flat...) the reference
	    * to get the value, but check to make sure that
	    * every result along the path is valid. For example:
	    *
	    * $hashtable.Customer.Name
	    *
	    * The $hashtable may be valid, but there is no key
	    * 'Customer' in the hashtable so we want to stop
	    * when we find a null value and return the null
	    * so the error gets logged.
	    */

	    try {
		for (int i = 0; i < numChildren; i++) {
		    result = jjtGetChild(i).execute(result, context);

		    if (result == null) {
			return null;
		    }
		}

		return result;
	    } catch (MethodInvocationException mie) {
		/*
		*  someone tossed their cookies
		*/

		rsvc.error("Method " + mie.MethodName + " threw exception for reference $" + rootString + " in template " + context.CurrentTemplateName + " at " + " [" + this.Line + "," + this.Column + "]");

		mie.ReferenceName = rootString;
		throw mie;
	    }
	}
Exemplo n.º 39
0
 public override bool render(InternalContextAdapter context, System.IO.TextWriter writer)
 {
     writer.Write(text);
     return(true);
 }
Exemplo n.º 40
0
 public override System.Object init(InternalContextAdapter context, System.Object data)
 {
     text = FirstToken.image;
     return(data);
 }
Exemplo n.º 41
0
Arquivo: Parse.cs Projeto: minskowl/MY
        /// <summary> Return name of this directive.
        /// </summary>

        /// <summary> Return type of this directive.
        /// </summary>

        /// <summary>  iterates through the argument list and renders every
        /// argument that is appropriate.  Any non appropriate
        /// arguments are logged, but render() continues.
        /// </summary>
        public override bool render(InternalContextAdapter context, System.IO.TextWriter writer, Node node)
        {
            /*
             *  did we get an argument?
             */
            if (node.jjtGetChild(0) == null)
            {
                rsvc.error("#parse() error :  null argument");
                return(false);
            }

            /*
             *  does it have a value?  If you have a null reference, then no.
             */
            System.Object value_Renamed = node.jjtGetChild(0).value_Renamed(context);

            if (value_Renamed == null)
            {
                rsvc.error("#parse() error :  null argument");
                return(false);
            }

            /*
             *  get the path
             */
            //UPGRADE_TODO: The equivalent in .NET for method 'java.Object.toString' may return a different value. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1043"'
            System.String arg = value_Renamed.ToString();

            /*
             *   see if we have exceeded the configured depth.
             *   If it isn't configured, put a stop at 20 just in case.
             */

            System.Object[] templateStack = context.TemplateNameStack;

            if (templateStack.Length >= rsvc.getInt(NVelocity.Runtime.RuntimeConstants_Fields.PARSE_DIRECTIVE_MAXDEPTH, 20))
            {
                System.Text.StringBuilder path = new System.Text.StringBuilder();

                for (int i = 0; i < templateStack.Length; ++i)
                {
                    path.Append(" > " + templateStack[i]);
                }

                rsvc.error("Max recursion depth reached (" + templateStack.Length + ")" + " File stack:" + path);
                return(false);
            }

            Resource current = context.CurrentResource;

            /*
             *  get the resource, and assume that we use the encoding of the current template
             *  the 'current resource' can be null if we are processing a stream....
             */

            System.String encoding = null;

            if (current != null)
            {
                encoding = current.Encoding;
            }
            else
            {
                encoding = (System.String)rsvc.getProperty(NVelocity.Runtime.RuntimeConstants_Fields.INPUT_ENCODING);
            }

            /*
             *  now use the Runtime resource loader to get the template
             */

            Template t = null;

            try {
                t = rsvc.getTemplate(arg, encoding);
            } catch (ResourceNotFoundException rnfe) {
                /*
                 * the arg wasn't found.  Note it and throw
                 */

                rsvc.error("#parse(): cannot find template '" + arg + "', called from template " + context.CurrentTemplateName + " at (" + Line + ", " + Column + ")");
                throw rnfe;
            } catch (ParseErrorException pee) {
                /*
                 * the arg was found, but didn't parse - syntax error
                 *  note it and throw
                 */

                rsvc.error("#parse(): syntax error in #parse()-ed template '" + arg + "', called from template " + context.CurrentTemplateName + " at (" + Line + ", " + Column + ")");

                throw pee;
            } catch (System.Exception e) {
                rsvc.error("#parse() : arg = " + arg + ".  Exception : " + e);
                return(false);
            }

            /*
             *  and render it
             */
            try {
                context.PushCurrentTemplateName(arg);
                ((SimpleNode)t.Data).render(context, writer);
            } catch (System.Exception e) {
                /*
                 *  if it's a MIE, it came from the render.... throw it...
                 */

                if (e is MethodInvocationException)
                {
                    throw (MethodInvocationException)e;
                }

                rsvc.error("Exception rendering #parse( " + arg + " )  : " + e);
                return(false);
            } finally {
                context.PopCurrentTemplateName();
            }

            return(true);
        }
Exemplo n.º 42
0
 public virtual System.Object execute(System.Object o, InternalContextAdapter context)
 {
     return(null);
 }
Exemplo n.º 43
0
 public virtual System.Object value_Renamed(InternalContextAdapter context)
 {
     return(null);
 }
Exemplo n.º 44
0
	/// <summary>  renders the block
	/// </summary>
	public override bool render(InternalContextAdapter context, System.IO.TextWriter writer) {
	    return jjtGetChild(1).render(context, writer);
	}
Exemplo n.º 45
0
	public override System.Object init(InternalContextAdapter context, System.Object data) {
	    /*
	    *  init our children
	    */

	    base.init(context, data);

	    /*
	    *  the only thing we can do in init() is getRoot()
	    *  as that is template based, not context based,
	    *  so it's thread- and context-safe
	    */

	    rootString = Root;

	    numChildren = jjtGetNumChildren();

	    /*
	    * and if appropriate...
	    */

	    if (numChildren > 0) {
		identifier = jjtGetChild(numChildren - 1).FirstToken.image;
	    }

	    return data;
	}
Exemplo n.º 46
0
 public override bool evaluate(InternalContextAdapter context)
 {
     return(jjtGetChild(0).evaluate(context));
 }
Exemplo n.º 47
0
	/// <summary>  gets the value of the reference and outputs it to the
	/// writer.
	/// *
	/// </summary>
	/// <param name="context"> context of data to use in getting value
	/// </param>
	/// <param name="writer">  writer to render to
	///
	/// </param>
	public override bool render(InternalContextAdapter context, System.IO.TextWriter writer) {

	    if (referenceType == RUNT) {
		writer.Write(rootString);
		return true;
	    }

	    System.Object value_Renamed = execute(null, context);

	    /*
	    *  if this reference is escaped (\$foo) then we want to do one of two things :
	    *  1) if this is a reference in the context, then we want to print $foo
	    *  2) if not, then \$foo  (its considered shmoo, not VTL)
	    */

	    if (escaped) {
		if (value_Renamed == null) {
		    writer.Write(escPrefix);
		    writer.Write("\\");
		    writer.Write(nullString);
		} else {
		    writer.Write(escPrefix);
		    writer.Write(nullString);
		}

		return true;
	    }

	    /*
	    *  the normal processing
	    *
	    *  if we have an event cartridge, get a new value object
	    */
	    EventCartridge ec = context.EventCartridge;

	    if (ec != null) {
		value_Renamed = ec.referenceInsert(nullString, value_Renamed);
	    }

	    /*
	    *  if value is null...
	    */

	    if (value_Renamed == null) {
		/*
		*  write prefix twice, because it's shmoo, so the \ don't escape each other...
		*/

		writer.Write(escPrefix);
		writer.Write(escPrefix);
		writer.Write(morePrefix);
		writer.Write(nullString);

		if (referenceType != QUIET_REFERENCE && rsvc.getBoolean(NVelocity.Runtime.RuntimeConstants_Fields.RUNTIME_LOG_REFERENCE_LOG_INVALID, true)) {
		    rsvc.warn(new ReferenceException("reference : template = " + context.CurrentTemplateName, this));
		}

		return true;
	    } else {
		/*
		*  non-null processing
		*/

		writer.Write(escPrefix);
		writer.Write(morePrefix);
		//UPGRADE_TODO: The equivalent in .NET for method 'java.Object.toString' may return a different value. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1043"'
		writer.Write(value_Renamed.ToString());

		return true;
	    }
	}
Exemplo n.º 48
0
 public override System.Object value_Renamed(InternalContextAdapter context)
 {
     return(jjtGetChild(0).value_Renamed(context));
 }
Exemplo n.º 49
0
	public override System.Object value_Renamed(InternalContextAdapter context) {
	    return (computableReference?execute(null, context):null);
	}
Exemplo n.º 50
0
 /// <summary> Execute method against context.
 /// </summary>
 public abstract System.Object execute(System.Object o, InternalContextAdapter context);
Exemplo n.º 51
0
        /// <summary>  invokes the method on the object passed in
        /// </summary>
        public override System.Object execute(System.Object o, InternalContextAdapter context)
        {
            AbstractExecutor executor = null;

            try {
                System.Type c = o.GetType();

                /*
                 *  first, see if we have this information cached.
                 */

                IntrospectionCacheData icd = context.ICacheGet(this);

                /*
                 * if we have the cache data and the class of the object we are
                 * invoked with is the same as that in the cache, then we must
                 * be allright.  The last 'variable' is the method name, and
                 * that is fixed in the template :)
                 */

                if (icd != null && icd.contextData == c)
                {
                    executor = (AbstractExecutor)icd.thingy;
                }
                else
                {
                    /*
                     *  otherwise, do the introspection, and cache it
                     */

                    executor = doIntrospection(c);

                    if (executor != null)
                    {
                        icd             = new IntrospectionCacheData();
                        icd.contextData = c;
                        icd.thingy      = executor;
                        context.ICachePut(this, icd);
                    }
                }
            } catch (System.Exception e) {
                rsvc.error("ASTIdentifier.execute() : identifier = " + identifier + " : " + e);
            }

            /*
             *  we have no executor... punt...
             */
            if (executor == null)
            {
                return(null);
            }

            /*
             *  now try and execute.  If we get a MIE, throw that
             *  as the app wants to get these.  If not, log and punt.
             */
            try {
                return(executor.execute(o, context));
            } catch (MethodInvocationException mie) {
                throw mie;
            } catch (System.Exception e) {
                rsvc.error("ASTIdentifier() : exception invoking method for identifier '" + identifier + "' in " + o.GetType() + " : " + e);
            }

            return(null);
        }
Exemplo n.º 52
0
        /// <summary>
        /// invokes the method.  Returns null if a problem, the
        /// actual return if the method returns something, or
        /// an empty string "" if the method returns void
        /// </summary>
        public override System.Object execute(System.Object o, InternalContextAdapter context)
        {
            /*
             *  new strategy (strategery!) for introspection. Since we want
             *  to be thread- as well as context-safe, we *must* do it now,
             *  at execution time.  There can be no in-node caching,
             *  but if we are careful, we can do it in the context.
             */

            MethodInfo   method   = null;
            PropertyInfo property = null;

            try {
                /*
                 *   check the cache
                 */

                IntrospectionCacheData icd = context.ICacheGet(this);
                System.Type            c   = o.GetType();

                /*
                 *  like ASTIdentifier, if we have cache information, and the
                 *  Class of Object o is the same as that in the cache, we are
                 *  safe.
                 */

                if (icd != null && icd.contextData == c)
                {
                    /*
                     * sadly, we do need recalc the values of the args, as this can
                     * change from visit to visit
                     */

                    for (int j = 0; j < paramCount; j++)
                    {
                        params_Renamed[j] = jjtGetChild(j + 1).value_Renamed(context);
                    }

                    /*
                     * and get the method from the cache
                     */
                    if (icd.thingy is MethodInfo)
                    {
                        method = (MethodInfo)icd.thingy;
                    }
                    if (icd.thingy is PropertyInfo)
                    {
                        property = (PropertyInfo)icd.thingy;
                    }
                }
                else
                {
                    /*
                     *  otherwise, do the introspection, and then
                     *  cache it
                     */

                    Object obj = doIntrospection(context, c);
                    if (obj is MethodInfo)
                    {
                        method = (MethodInfo)obj;
                    }
                    if (obj is PropertyInfo)
                    {
                        property = (PropertyInfo)obj;
                    }

                    if (obj != null)
                    {
                        icd             = new IntrospectionCacheData();
                        icd.contextData = c;
                        icd.thingy      = obj;
                        context.ICachePut(this, icd);
                    }
                }

                /*
                 *  if we still haven't gotten the method, either we are calling
                 *  a method that doesn't exist (which is fine...)  or I screwed
                 *  it up.
                 */

                if (method == null && property == null)
                {
                    return(null);
                }
            } catch (MethodInvocationException mie) {
                /*
                 *  this can come from the doIntrospection(), as the arg values
                 *  are evaluated to find the right method signature.  We just
                 *  want to propogate it here, not do anything fancy
                 */

                throw mie;
            } catch (System.Exception e) {
                /*
                 *  can come from the doIntropection() also, from Introspector
                 */

                rsvc.error("ASTMethod.execute() : exception from introspection : " + e);
                return(null);
            }

            try {
                /*
                 *  get the returned object.  It may be null, and that is
                 *  valid for something declared with a void return type.
                 *  Since the caller is expecting something to be returned,
                 *  as long as things are peachy, we can return an empty
                 *  String so ASTReference() correctly figures out that
                 *  all is well.
                 */

                Object obj = null;
                if (method != null)
                {
                    obj = method.Invoke(o, (System.Object[])params_Renamed);
                    if (obj == null && method.ReturnType == System.Type.GetType("System.Void"))
                    {
                        obj = String.Empty;
                    }
                }
                else
                {
                    obj = property.GetValue(o, null);
                }

                return(obj);
            } catch (System.Reflection.TargetInvocationException ite) {
                /*
                 *  In the event that the invocation of the method
                 *  itself throws an exception, we want to catch that
                 *  wrap it, and throw.  We don't log here as we want to figure
                 *  out which reference threw the exception, so do that
                 *  above
                 */

                EventCartridge ec = context.EventCartridge;

                /*
                 *  if we have an event cartridge, see if it wants to veto
                 *  also, let non-Exception Throwables go...
                 */

                if (ec != null && ite.GetBaseException() is System.Exception)
                {
                    try {
                        return(ec.methodException(o.GetType(), methodName, (System.Exception)ite.GetBaseException()));
                    } catch (System.Exception e) {
                        throw new MethodInvocationException("Invocation of method '" + methodName + "' in  " + o.GetType() + " threw exception " + e.GetType() + " : " + e.Message, e, methodName);
                    }
                }
                else
                {
                    /*
                     * no event cartridge to override. Just throw
                     */

                    throw new MethodInvocationException("Invocation of method '" + methodName + "' in  " + o.GetType() + " threw exception " + ite.GetBaseException().GetType() + " : " + ite.GetBaseException().Message, ite.GetBaseException(), methodName);
                }
            } catch (System.Exception e) {
                rsvc.error("ASTMethod.execute() : exception invoking method '" + methodName + "' in " + o.GetType() + " : " + e);
                return(null);
            }
        }
Exemplo n.º 53
0
	public override bool evaluate(InternalContextAdapter context) {
	    return false;
	}
Exemplo n.º 54
0
 /// <summary>  renders the block
 /// </summary>
 public override bool render(InternalContextAdapter context, System.IO.TextWriter writer)
 {
     return(jjtGetChild(1).render(context, writer));
 }
Exemplo n.º 55
0
 public override System.Object value_Renamed(InternalContextAdapter context)
 {
     return(value_Renamed_Field);
 }
Exemplo n.º 56
0
	/// <summary> An ASTElseStatement is true if the expression
	/// it contains evaluates to true. Expressions know
	/// how to evaluate themselves, so we do that
	/// here and return the value back to ASTIfStatement
	/// where this node was originally asked to evaluate
	/// itself.
	/// </summary>
	public override bool evaluate(InternalContextAdapter context) {
	    return jjtGetChild(0).evaluate(context);
	}
Exemplo n.º 57
0
 public override bool evaluate(InternalContextAdapter context)
 {
     return(false);
 }
Exemplo n.º 58
0
 public override System.Object value_Renamed(InternalContextAdapter context)
 {
     return(evaluate(context)?false:true);
 }
Exemplo n.º 59
0
	public override System.Object value_Renamed(InternalContextAdapter context) {
	    return (evaluate(context)?false:true);
	}
Exemplo n.º 60
0
 public virtual bool evaluate(InternalContextAdapter context)
 {
     return(false);
 }