예제 #1
0
	public Identifier  name() //throws RecognitionException, TokenStreamException
{
		Identifier ident;
		
		IToken  t1 = null;
		IToken  t2 = null;
		IToken  t3 = null;
		ident = null;
		
		switch ( LA(1) )
		{
		case IDENT:
		{
			t1 = LT(1);
			match(IDENT);
			if (0==inputState.guessing)
			{
				ident = new OpaqueIdentifier(t1.getText());
			}
			break;
		}
		case STATICIDENT:
		{
			t2 = LT(1);
			match(STATICIDENT);
			if (0==inputState.guessing)
			{
				ident = new StaticVarIdentifier(t2.getText());
			}
			break;
		}
		case INSTIDENT:
		{
			t3 = LT(1);
			match(INSTIDENT);
			if (0==inputState.guessing)
			{
				ident = new InstanceVarIdentifier(t3.getText());
			}
			break;
		}
		default:
		{
			throw new NoViableAltException(LT(1), getFilename());
		}
		 }
		return ident;
	}
예제 #2
0
		public virtual void VisitOpaqueIdentifier(OpaqueIdentifier opaqueIdentifier)
		{
			VisitNode(opaqueIdentifier.TypeReference);
			
		}
예제 #3
0
파일: TreeWalker.cs 프로젝트: atczyc/castle
		public override void VisitOpaqueIdentifier(OpaqueIdentifier identifier)
		{
			nodeStack.Push( CurrentNode.Nodes.Add("OpaqueIdentifier " + identifier.Name + " - " + identifier.TypeReference ));
			CurrentNode.Tag = identifier;
			
			base.VisitOpaqueIdentifier(identifier);

			nodeStack.Pop();
		}