|
|||||
FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Typing information for the CST system. The types here are those used by CSTNode, Token, and Reduction.
Constructor Summary | |
Types()
|
Method Summary | |
---|---|
static void |
addDescription(int type, String description)
Adds a description to the set. |
static void |
addDescription(Integer type, String description)
Adds a description to the set. |
static void |
addTranslation(String text, int type)
Adds a element to the TEXTS and LOOKUP. |
static boolean |
canMean(int actual, int preferred)
Given two types, returns true if the first can be viewed as the second. |
static String |
getDescription(int type)
Gets the description for the specified type. |
static int |
getPrecedence(int type, boolean throwIfInvalid)
Returns the precendence of the specified operator. |
static String |
getText(int type)
Returns the text for the specified type. |
static int |
lookup(String text, int filter)
Returns the type for the specified symbol/keyword text. |
static int |
lookupKeyword(String text)
Returns the type for the specified keyword text. |
static int |
lookupSymbol(String text)
Returns the type for the specified symbol text. |
static void |
makePostfix(CSTNode node, boolean throwIfInvalid)
Converts a node from a generic type to a specific postfix type. |
static void |
makePrefix(CSTNode node, boolean throwIfInvalid)
Converts a node from a generic type to a specific prefix type. |
static boolean |
ofType(int specific, int general)
Given two types, returns true if the second describes the first. |
Constructor Detail |
---|
Types()
Method Detail |
---|
static void addDescription(int type, String description)
static void addDescription(Integer type, String description)
static void addTranslation(String text, int type)
public static boolean canMean(int actual, int preferred)
canMean()
is orthogonal to ofType()
.
public static String getDescription(int type)
public static int getPrecedence(int type, boolean throwIfInvalid)
public static String getText(int type)
public static int lookup(String text, int filter)
public static int lookupKeyword(String text)
public static int lookupSymbol(String text)
public static void makePostfix(CSTNode node, boolean throwIfInvalid)
GroovyBugError
if the type can't be converted.
public static void makePrefix(CSTNode node, boolean throwIfInvalid)
GroovyBugError
if the type can't be converted
and requested.
public static boolean ofType(int specific, int general)