Package antlr.preprocessor
Class Rule
- java.lang.Object
-
- antlr.preprocessor.Rule
-
class Rule extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringargsprotected booleanbangprotected Stringblockprotected GrammarenclosingGrammarprotected StringinitActionprotected Stringnameprotected IndexedVectoroptionsprotected StringreturnValueprotected StringthrowsSpecprotected Stringvisibility
-
Constructor Summary
Constructors Constructor Description Rule(String n, String b, IndexedVector options, Grammar gr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetArgs()booleangetBang()StringgetName()StringgetReturnValue()StringgetVisibility()booleannarrowerVisibility(Rule rule)If 'rule' narrows the visible of 'this', return true; For example, 'this' is public and 'rule' is private, true is returned.booleansameSignature(Rule rule)Two rules have the same signature if they have: same name same return value same args I do a simple string compare now, but later the type could be pulled out so it is insensitive to names of args etc...voidsetArgs(String a)voidsetBang()voidsetEnclosingGrammar(Grammar g)voidsetInitAction(String a)voidsetOptions(IndexedVector options)voidsetReturnValue(String ret)voidsetThrowsSpec(String t)voidsetVisibility(String v)StringtoString()
-
-
-
Field Detail
-
name
protected String name
-
block
protected String block
-
args
protected String args
-
returnValue
protected String returnValue
-
throwsSpec
protected String throwsSpec
-
initAction
protected String initAction
-
options
protected IndexedVector options
-
visibility
protected String visibility
-
enclosingGrammar
protected Grammar enclosingGrammar
-
bang
protected boolean bang
-
-
Constructor Detail
-
Rule
public Rule(String n, String b, IndexedVector options, Grammar gr)
-
-
Method Detail
-
getArgs
public String getArgs()
-
getBang
public boolean getBang()
-
getName
public String getName()
-
getReturnValue
public String getReturnValue()
-
getVisibility
public String getVisibility()
-
narrowerVisibility
public boolean narrowerVisibility(Rule rule)
If 'rule' narrows the visible of 'this', return true; For example, 'this' is public and 'rule' is private, true is returned. You cannot narrow the vis. of a rule.
-
sameSignature
public boolean sameSignature(Rule rule)
Two rules have the same signature if they have: same name same return value same args I do a simple string compare now, but later the type could be pulled out so it is insensitive to names of args etc...
-
setArgs
public void setArgs(String a)
-
setBang
public void setBang()
-
setEnclosingGrammar
public void setEnclosingGrammar(Grammar g)
-
setInitAction
public void setInitAction(String a)
-
setOptions
public void setOptions(IndexedVector options)
-
setReturnValue
public void setReturnValue(String ret)
-
setThrowsSpec
public void setThrowsSpec(String t)
-
setVisibility
public void setVisibility(String v)
-
-