|
antlraux package v0.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface is the main object of antlraux's type system. A Type is a very basic object that only has two mandatory attributes: an integuer "tag" and a name.
Their functionality is similar to Token.type and Token.text, but not exactly the same.
In most programmation languajes, there are some Tokens that represent "basic types" - for example, token INT_TYPE represents the Token wose text is allways "int" and wose token type is INT_TYPE, whatever integer it is. The Type represented by that token will have INT_TYPE as tag and "int" as name.
However other tokens don't act that way - take the class token. A class definition may begin with a token with RES_CLASS type and "class" text, but we're not sure of what type we're defining until we see the class' name. Let's suppose that the class name's "A". In this case, the Type represented will have RES_CLASS as tag, but its name will be "A" instead of "class".
In conclusion, new Scope specifies the "type of Type" we're dealing with, while name really makes difference between Types of the same type.
Field Summary | |
static java.lang.String |
DEFAULT_NAME
|
static int |
DEFAULT_TAG
|
Method Summary | |
boolean |
equals(java.lang.Object other)
|
java.lang.String |
getName()
Returns the Type's name |
int |
getTag()
Returns the Type's tag |
void |
setName(java.lang.String s)
Sets the Type's name. |
void |
setTag(int tag)
Sets the Type's tag |
java.lang.String |
toString()
|
Field Detail |
public static final java.lang.String DEFAULT_NAME
public static final int DEFAULT_TAG
Method Detail |
public java.lang.String getName()
public int getTag()
public void setName(java.lang.String s)
public void setTag(int tag)
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
antlraux package v0.2.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |