| java.lang.Object fri.patterns.interpreter.parsergenerator.util.SymbolToName
SymbolToName | abstract public class SymbolToName (Code) | | The contained methods are needed to generate nonterminal names for spawned rules,
e.g. for a repeatable nullable rule "(a | b | c)" from the rule "e ::= (a | b | c)* d;".
author: (c) 2000, Fritz Ritzberger |
Method Summary | |
public static String | convert(char c) Returns a symbolic name for passed symbol, e.g. | public static String | makeIdentifier(String symbol) Converts the passed character sequence (symbol) to a name that can be used as identifier (but not as Java identifier). | public static String | makeIdentifier(String symbol, boolean startIsSignificant) Converts the passed character sequence (symbol) to a name that can be used as identifier, optionally as Java identifier. | public static String | makeIdentifier(String symbol, String enclosingQuoteSubstitute) Converts the passed character sequence (symbol) to a name that can be used as identifier (but not as Java identifier). | public static String | makeIdentifier(String symbol, String enclosingQuoteSubstitute, boolean startIsSignificant) Converts the passed character sequence (symbol) to a name that can be used as identifier, optionally as Java identifier. |
convert | public static String convert(char c)(Code) | | Returns a symbolic name for passed symbol, e.g. "lparen" for "(".
|
makeIdentifier | public static String makeIdentifier(String symbol)(Code) | | Converts the passed character sequence (symbol) to a name that can be used as identifier (but not as Java identifier).
If enclosing quotes are found, they will be substituted by "_".
Parameters: symbol - character sequence to be converted to identifier |
makeIdentifier | public static String makeIdentifier(String symbol, boolean startIsSignificant)(Code) | | Converts the passed character sequence (symbol) to a name that can be used as identifier, optionally as Java identifier.
If enclosing quotes are found, they will be substituted by "_".
Parameters: symbol - character sequence to be converted to identifier Parameters: startIsSignificant - when true a Java identifier is produced |
makeIdentifier | public static String makeIdentifier(String symbol, String enclosingQuoteSubstitute)(Code) | | Converts the passed character sequence (symbol) to a name that can be used as identifier (but not as Java identifier).
If enclosing quotes are found, they will be substituted by passed substitute string.
Parameters: symbol - character sequence to be converted to identifier Parameters: enclosingQuoteSubstitute - the string to be used for enclosing quotes |
makeIdentifier | public static String makeIdentifier(String symbol, String enclosingQuoteSubstitute, boolean startIsSignificant)(Code) | | Converts the passed character sequence (symbol) to a name that can be used as identifier, optionally as Java identifier.
If enclosing quotes are found, they will be substituted by passed substitute string.
Parameters: symbol - character sequence to be converted to identifier Parameters: enclosingQuoteSubstitute - the string to be used for enclosing quotes Parameters: startIsSignificant - when true a Java identifier is produced |
|
|