/// <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;
		}
		/// <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>  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);
        }
Exemple #4
0
		public void Reference()
		{
			/*@bgen(jjtree) Reference */
			ASTReference jjtn000 = new ASTReference(this, ParserTreeConstants.REFERENCE);
			bool jjtc000 = true;
			nodeTree.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(GetCurrentTokenKind())
				{
					case ParserConstants.IDENTIFIER:
						ConsumeToken(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;
							}
							ConsumeToken(ParserConstants.DOT);
							if (jj_2_6(3))
							{
								Method();
							}
							else
							{
								switch(GetCurrentTokenKind())
								{
									case ParserConstants.IDENTIFIER:
										Identifier();
										break;

									default:
										jj_la1[23] = jj_gen;
										ConsumeToken(-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:
						ConsumeToken(ParserConstants.LCURLY);
						ConsumeToken(ParserConstants.IDENTIFIER);
						while(true)
						{
							if (!jj_2_7(2))
							{
								//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;
							}
							ConsumeToken(ParserConstants.DOT);
							if (jj_2_8(3))
							{
								Method();
							}
							else
							{
								switch(GetCurrentTokenKind())
								{
									case ParserConstants.IDENTIFIER:
										Identifier();
										break;

									default:
										jj_la1[24] = jj_gen;
										ConsumeToken(-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:
						;

						ConsumeToken(ParserConstants.RCURLY);
						break;

					default:
						jj_la1[25] = jj_gen;
						ConsumeToken(-1);
						throw new ParseException();
				}
			}
			catch(System.Exception exception)
			{
				nodeTree.ClearNodeScope(jjtn000);
				jjtc000 = false;
				if (exception is SystemException)
				{
					throw;
				}
				if (exception is ParseException)
				{
					throw;
				}
				throw (ApplicationException) exception;
			}
			finally
			{
				if (jjtc000)
				{
					nodeTree.CloseNodeScope(jjtn000, true);
				}
			}
		}
		public virtual Object Visit(ASTReference node, Object data)
		{
			data = node.ChildrenAccept(this, data);
			return data;
		}
		/// <summary>Display an ASTReference node
		/// </summary>
		public override Object Visit(ASTReference node, Object data)
		{
			return ShowNode(node, data);
		}