|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectxtc.tree.Visitor
xtc.parser.Copier
public class Copier
Visitor to copy grammar nodes. This visitor makes deep copies of
grammars, modules, productions, and elements. Note that when
copying elements, this visitor must be invoked through the copy(Element) method. Further note that, if the element to be
copied contains a generic node value or a generic recursion value,
the element must also contain all bindings referenced by that value
element. Otherwise, an IllegalArgumentException is
signalled.
| Field Summary | |
|---|---|
protected java.util.List<Binding> |
source
The list of source bindings. |
protected java.util.List<Binding> |
target
The list of target bindings. |
| Constructor Summary | |
|---|---|
Copier()
Create a new copier. |
|
| Method Summary | ||
|---|---|---|
|
copy(T e)
Copy the specified element. |
|
protected Binding |
match(Binding b)
Match the specified binding with its copy. |
|
protected void |
patch(java.util.List<Binding> bindings)
Patch the specified bindings. |
|
Action |
visit(Action a)
Copy the specified action. |
|
ActionBaseValue |
visit(ActionBaseValue v)
Copy the specified action base value. |
|
AlternativeAddition |
visit(AlternativeAddition p)
Copy the specified alternative addition. |
|
AlternativeRemoval |
visit(AlternativeRemoval p)
Copy the specified alternative removal. |
|
Binding |
visit(Binding b)
Copy the specified binding. |
|
BindingValue |
visit(BindingValue v)
Copy the specified binding value. |
|
CharCase |
visit(CharCase c)
Copy the specified character case. |
|
CharClass |
visit(CharClass c)
Copy the specified character class. |
|
CharSwitch |
visit(CharSwitch s)
Copy the specified character switch. |
|
Comment |
visit(Comment c)
Copy the specified comment. |
|
Element |
visit(Element e)
Visit the specified element. |
|
FollowedBy |
visit(FollowedBy p)
Copy the specified followed-by predicate. |
|
FullProduction |
visit(FullProduction p)
Copy the specified full production. |
|
GenericActionValue |
visit(GenericActionValue v)
Copy the specified generic action value. |
|
GenericNodeValue |
visit(GenericNodeValue v)
Copy the specified generic node value. |
|
GenericRecursionValue |
visit(GenericRecursionValue v)
Copy the specified generic recursion value. |
|
Grammar |
visit(Grammar g)
Copy the specified grammar. |
|
Module |
visit(Module m)
Copy the specified module. |
|
ModuleImport |
visit(ModuleImport i)
Copy the specified module import declaration. |
|
ModuleInstantiation |
visit(ModuleInstantiation i)
Copy the specified module instantiation declaration. |
|
ModuleList |
visit(ModuleList l)
Copy the specified module list. |
|
ModuleModification |
visit(ModuleModification m)
Copy the specified module modification. |
|
NotFollowedBy |
visit(NotFollowedBy p)
Copy the specified not-followed-by predicate. |
|
Option |
visit(Option o)
Copy the specified option. |
|
OrderedChoice |
visit(OrderedChoice c)
Copy the specified ordered choice. |
|
ParserAction |
visit(ParserAction pa)
Copy the specified parser action. |
|
ParseTreeNode |
visit(ParseTreeNode n)
Copy the specified parse tree node. |
|
ProductionOverride |
visit(ProductionOverride p)
Copy the specified production override. |
|
ProperListValue |
visit(ProperListValue v)
Copy the specified proper list value. |
|
Repetition |
visit(Repetition r)
Copy the specified repetition. |
|
SemanticPredicate |
visit(SemanticPredicate p)
Copy the specified semantic predicate. |
|
Sequence |
visit(Sequence s)
Copy the specified sequence. |
|
StringMatch |
visit(StringMatch m)
Copy the specified string match. |
|
VoidedElement |
visit(VoidedElement v)
Copy the specified voided element. |
|
| Methods inherited from class xtc.tree.Visitor |
|---|
dispatch, equals, hashCode, iterate, map, mapInPlace, unableToVisit, visit |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.List<Binding> source
protected java.util.List<Binding> target
| Constructor Detail |
|---|
public Copier()
| Method Detail |
|---|
protected Binding match(Binding b)
b - The binding.
java.lang.IllegalArgumentException - Signals that the specified
binding has no copy.protected void patch(java.util.List<Binding> bindings)
bindings - The bindings to patch.public <T extends Element> T copy(T e)
e - The element.
java.lang.IllegalArgumentException - Signals that the specified element is incomplete.public Grammar visit(Grammar g)
public Module visit(Module m)
public Comment visit(Comment c)
public ModuleImport visit(ModuleImport i)
public ModuleInstantiation visit(ModuleInstantiation i)
public ModuleModification visit(ModuleModification m)
public ModuleList visit(ModuleList l)
public FullProduction visit(FullProduction p)
public AlternativeAddition visit(AlternativeAddition p)
public AlternativeRemoval visit(AlternativeRemoval p)
public ProductionOverride visit(ProductionOverride p)
public OrderedChoice visit(OrderedChoice c)
public Repetition visit(Repetition r)
public Option visit(Option o)
public Sequence visit(Sequence s)
public FollowedBy visit(FollowedBy p)
public NotFollowedBy visit(NotFollowedBy p)
public SemanticPredicate visit(SemanticPredicate p)
public VoidedElement visit(VoidedElement v)
public Binding visit(Binding b)
public StringMatch visit(StringMatch m)
public CharClass visit(CharClass c)
public CharCase visit(CharCase c)
public CharSwitch visit(CharSwitch s)
public Action visit(Action a)
public ParserAction visit(ParserAction pa)
public ParseTreeNode visit(ParseTreeNode n)
public BindingValue visit(BindingValue v)
public ProperListValue visit(ProperListValue v)
public ActionBaseValue visit(ActionBaseValue v)
public GenericNodeValue visit(GenericNodeValue v)
public GenericActionValue visit(GenericActionValue v)
public GenericRecursionValue visit(GenericRecursionValue v)
public Element visit(Element e)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||