fri.patterns.interpreter.parsergenerator.lexer
Interface LexerSemantic

All Known Implementing Classes:
LexerReflectSemantic

public interface LexerSemantic

LexerSemantic receives a Rule and its a ResultTree with range. It can look inside the syntax tree of a scanned token. Calling resultTree.toString() will return the scanned text for that rule. The responsibility of a LexerSemantic is to provide a Set of nonterminal Strings contained in the used lexer syntax which it wants to process. If it provides no such Set, all rules are passed to the Semantic (which will be very time-consuming). Created on 21.09.2005

Author:
Fritz Ritzberger

Method Summary
 java.util.Set getIgnoredNonterminals()
          Can return the String Set of nonterminals (must occur in syntax on left side) this LexerSemantic does not want to dispatch.
 java.util.Set getWantedNonterminals()
          Can return the String Set of nonterminals (must occur in syntax on left side) this LexerSemantic wants to dispatch.
 void ruleEvaluated(Rule rule, ResultTree resultTree)
          This is called by LexerImpl with a lexing Rule and its scanned result tree and range.
 

Method Detail

ruleEvaluated

public void ruleEvaluated(Rule rule,
                          ResultTree resultTree)
This is called by LexerImpl with a lexing Rule and its scanned result tree and range. Calling resultTree.toString() will return the scanned text for the rule. Calling resultTree.getRange() will return the range of the rule within input. No value stack is available for that semantic, so the method does not return anything.


getWantedNonterminals

public java.util.Set getWantedNonterminals()
Can return the String Set of nonterminals (must occur in syntax on left side) this LexerSemantic wants to dispatch. Returning null will enable all nonterminals or rules.


getIgnoredNonterminals

public java.util.Set getIgnoredNonterminals()
Can return the String Set of nonterminals (must occur in syntax on left side) this LexerSemantic does not want to dispatch. This is an alternative to getWantedNonterminals(). Returning null will not ignore any nonterminal or rule.