|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HeadFinder
Specifies the methods for the head-finding component of a language package. A head finder determines the distinguished head child for any context-free production.
A language package must include an implementation of this interface.
AbstractHeadFinder
Method Summary | |
---|---|
Sexp |
addHeadInformation(Sexp tree)
Perform head-finding in tree , augmenting nodes that are the
head child of their parent by appending headSuffix() . |
int |
findHead(Sexp tree)
Finds the head for the production at the root of the specified subtree. |
int |
findHead(Sexp tree,
Symbol lhs,
SexpList rhs)
Finds the head for the grammar production lhs → rhs . |
String |
headSuffix()
The suffix to append to nodes that are the head children of their respective parents when marking heads via addHeadInformation(Sexp) . |
Method Detail |
---|
int findHead(Sexp tree)
findHead(Sexp,Symbol,SexpList)
.
tree
- the subtree for whose root production to find the head
findHead(Sexp,Symbol,SexpList)
int findHead(Sexp tree, Symbol lhs, SexpList rhs)
lhs → rhs
. This
method may destructively modify rhs
.
tree
- the original subtree in which to find the head child, or
null
if the subtree is not availablelhs
- the nonterminal label that is the left-hand side of a grammar
productionrhs
- a list of symbols that is the right-hand side of a grammar
production
rhs
Sexp addHeadInformation(Sexp tree)
tree
, augmenting nodes that are the
head child of their parent by appending headSuffix()
. This method
is useful for head-finding debugging.
tree
objectString headSuffix()
addHeadInformation(Sexp)
.
|
Parsing Engine | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |