private Expression designator(boolean acceptAddressOf) throws RequiredTokenException 
	{
		enterRule(NonTerminal.DESIGNATOR);
		Token dereferencedToken = emitTerminal(require(Token.Kind.IDENTIFIER));
		Symbol dereferencedSymbol = null;
		try 
		{
			dereferencedSymbol = resolveSymbol(dereferencedToken);
		}
		catch (UnresolvableSymbolException e) 
		{
			exitRule();
			return new Error(
				dereferencedToken.getLineNumber(),
				dereferencedToken.getCharPos(),
				String.format("Unable to resolve symbol \"%s\".", dereferencedToken.getLexeme()));
		}
		Index prevIndex = null;
		while(accept(Token.Kind.OPEN_BRACKET))
		{
			Expression indexExpression = expression0();
			require(Token.Kind.CLOSE_BRACKET);
			
			if(prevIndex == null)
			{
				prevIndex = new Index(
					((Command)indexExpression).lineNumber(), 
					((Command)indexExpression).charPosition(), 
					new AddressOf(
						dereferencedToken.getLineNumber(),
						dereferencedToken.getCharPos(),
						dereferencedSymbol),
					indexExpression);
			}
			else
			{
				prevIndex = new Index(
					((Command)indexExpression).lineNumber(),
					((Command)indexExpression).charPosition(),
					prevIndex,
					indexExpression);
			}
		}
		exitRule();
		if(acceptAddressOf && prevIndex == null)
		{
			return new AddressOf(
				dereferencedToken.getLineNumber(),
				dereferencedToken.getCharPos(),
				dereferencedSymbol);
		}
		return new Dereference(
			dereferencedToken.getLineNumber(),
			dereferencedToken.getCharPos(),
			prevIndex != null
				? prevIndex
				: new AddressOf(
					dereferencedToken.getLineNumber(),
					dereferencedToken.getCharPos(),
					dereferencedSymbol));
	}