fri.patterns.interpreter.parsergenerator.lexer.semantics
Class LexerReflectSemantic

java.lang.Object
  |
  +--fri.patterns.interpreter.parsergenerator.lexer.semantics.LexerReflectSemantic
All Implemented Interfaces:
LexerSemantic

public abstract class LexerReflectSemantic
extends java.lang.Object
implements LexerSemantic

A LexerSemantic that provides the Set of wanted String nonterminals by method reflection. Callback methods must be of the form

 	public void EncodingDecl(ResultTree resultTree)	{
 		this.encodingDecl = resultTree.toString();
 	}
 
Created on 21.09.2005

Author:
Fritz Ritzberger

Constructor Summary
LexerReflectSemantic()
           
 
Method Summary
 java.util.Set getIgnoredNonterminals()
          Returns null as getWantedNonterminals() is provided.
 java.util.Set getWantedNonterminals()
          Provides the Set of wanted nonterminal Strings by searching for public void methods with (String, Token.Range) arguments.
 void ruleEvaluated(Rule rule, ResultTree resultTree)
          As expected, this method delegates to the method that is named like the nonterminal of the passed Rule, with resultTree as the only argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LexerReflectSemantic

public LexerReflectSemantic()
Method Detail

ruleEvaluated

public void ruleEvaluated(Rule rule,
                          ResultTree resultTree)
As expected, this method delegates to the method that is named like the nonterminal of the passed Rule, with resultTree as the only argument.

Specified by:
ruleEvaluated in interface LexerSemantic

getWantedNonterminals

public java.util.Set getWantedNonterminals()
Provides the Set of wanted nonterminal Strings by searching for public void methods with (String, Token.Range) arguments.

Specified by:
getWantedNonterminals in interface LexerSemantic

getIgnoredNonterminals

public java.util.Set getIgnoredNonterminals()
Returns null as getWantedNonterminals() is provided.

Specified by:
getIgnoredNonterminals in interface LexerSemantic