|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.sketch.parser2d.SingleRule
public class SingleRule
A parse rule implementation that matches the RHS of a production and generates the LHS. Subclasses fill in the match() method to impose the constraints of the rule.
Constructor Summary | |
---|---|
SingleRule(String lhsType,
String rhsName,
String rhsType)
A utility constructor which simply takes strings with single words separated by whitespace, separates these strings into arrays, and calls the standard array constructor. |
Method Summary | |
---|---|
Type |
getLHSType()
Return the LHS type of the rule. |
String[] |
getRHSNames()
Return the RHS names of the rule. |
Type[] |
getRHSTypes()
Return the RHS types of the rule. |
CompositeElement |
match(CompositeElement[] rhs,
Scene db)
Match the given scene elements and return a resulting element, or return null if there is no match. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SingleRule(String lhsType, String rhsName, String rhsType)
Method Detail |
---|
public Type getLHSType()
getLHSType
in interface Rule
public Type[] getRHSTypes()
getRHSTypes
in interface Rule
public String[] getRHSNames()
getRHSNames
in interface Rule
public CompositeElement match(CompositeElement[] rhs, Scene db)
match
in interface Rule
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |