public class State extends Object
NonTerminal symbols
Terminal symbols
Rules of the form
α → β
where:P = (N ∪ T) × I
Actions or
state transitions.GoTos.
For generation purposes ii is augmented with
from ∈ I
symbol ∈ N ∪ T
default ∈ A
review ∈ {true, false}
doti is a pair (ri ∈ R, pos ∈
Int ≤ |ri|), where |ri| is the number of items in a rule ri
| Constructor and Description |
|---|
State(int id,
int from,
Symbol symbol)
Construct a state
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAllClosureDots(List<Dot> dots)
Merge all dots into this objects closure dots.
|
void |
addAllKernelDots(List<Dot> dots)
Merge all dots into this objects kernel dots.
|
void |
addClosureDot(Dot dot)
Add a dot to the closure dot set
|
void |
addKernelDot(Dot dot)
Add a dot to the kernel dot set
|
boolean |
equals(Object obj) |
List<Action> |
getActions() |
int |
getActionSize() |
List<Dot> |
getAllDots() |
List<Dot> |
getClosureDots() |
int |
getDefaultValue() |
Dot |
getDot(int i) |
int |
getFrom() |
int |
getId() |
List<Dot> |
getKernelDots() |
int |
getMessage() |
int |
getPosition() |
int[] |
getRow() |
Symbol |
getSymbol() |
int |
getSymbolId()
Convenience method to get the id of the originating symbol
|
boolean |
isReview() |
void |
setActions(List<Action> actions) |
void |
setDefaultValue(int defaultValue) |
void |
setFrom(int from) |
void |
setId(int id) |
void |
setMessage(int message) |
void |
setPosition(int position) |
void |
setReview(boolean review) |
void |
setRow(int[] row) |
void |
setSymbol(Symbol symbol) |
String |
toString()
Returns a representation of the state (all its rules and dots) with
additional information of what is this state's origin (what state this is
coming from, and with what symbol)
|
public State(int id,
int from,
Symbol symbol)
id - the id of the statefrom - the state that originated the new statesymbol - the symbol that was followed to reach this statepublic int getSymbolId()
public Dot getDot(int i)
i - the indexpublic void addKernelDot(Dot dot)
dot - the dot to be addedpublic void addClosureDot(Dot dot)
dot - the dot to be addedpublic void addAllKernelDots(List<Dot> dots)
dots - is the list of dots to merge frompublic void addAllClosureDots(List<Dot> dots)
dots - is the list of dots to merge frompublic int getId()
public void setId(int id)
id - the id to setpublic boolean isReview()
public void setReview(boolean review)
review - the review to setpublic int getFrom()
public void setFrom(int from)
from - the from to setpublic Symbol getSymbol()
public void setSymbol(Symbol symbol)
symbol - the symbol to setpublic int getDefaultValue()
public void setDefaultValue(int defaultValue)
defaultValue - the defaultValue to setpublic int getPosition()
public void setPosition(int position)
position - the position to setpublic int getActionSize()
public int getMessage()
public void setMessage(int message)
message - the message to setpublic int[] getRow()
public void setRow(int[] row)
row - the row to set. The array
is copied into a new array since the original array's
content may change.public boolean equals(Object obj)
equals in class ObjectObject.equals(java.lang.Object)public String toString()
toString in class ObjectObject.toString()Copyright © 2017. All rights reserved.