|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--antlr.Tool
Untamed:
Field Summary | |
private static BitSet |
cmdLineArgValid
|
(package private) ToolErrorHandler |
errorHandler
Object that handles analysis errors |
(package private) Reader |
f
|
(package private) boolean |
genDiagnostics
Generate diagnostics? (vs code) |
protected static boolean |
genHashLines
|
(package private) boolean |
genHTML
Generate HTML vs code? |
(package private) String |
grammarFile
|
protected boolean |
hasError
Was there an error during parsing or analysis? |
protected static String |
literalsPrefix
|
protected static NameSpace |
nameSpace
C++ file level options |
protected static String |
namespaceAntlr
|
protected static String |
namespaceStd
|
protected static String |
outputDir
Current output directory for generated files |
protected static boolean |
upperCaseMangledLiterals
|
static String |
version
Enabled: |
Constructor Summary | |
Tool()
Enabled: Construct a new Tool. |
Method Summary | |
private static void |
checkForInvalidArguments(String[] args,
BitSet cmdLineArgValid)
|
static void |
copyFile(String source_name,
String dest_name)
Enabled: This example is from the book _Java in a Nutshell_ by David Flanagan. |
protected void |
doEverything(String[] args)
Perform processing on the grammar file. |
void |
error(String s)
Enabled: Issue an error |
void |
error(String s,
String file,
int line)
Enabled: Issue an error with line number information |
static Object |
factory(String p)
Enabled: When we are 1.1 compatible... |
static String |
fileMinusPath(String f)
Enabled: |
Reader |
getGrammarReader()
Enabled: |
String |
getLanguage(MakeGrammar behavior)
Enabled: Determine the language used for this run of ANTLR This was made a method so the subclass can override it |
static String |
getOutputDirectory()
Enabled: |
private static void |
help()
|
static void |
main(String[] args)
Enabled: |
static PrintWriter |
openOutputFile(String f)
Enabled: |
static void |
panic()
Enabled: Issue an unknown fatal error |
static void |
panic(String s)
Enabled: Issue a fatal error message |
static File |
parent(File f)
Enabled: |
static Vector |
parseSeparatedList(String list,
char separator)
Enabled: Parse a list such as "f1.g;f2.g;..." and return a Vector of the elements. |
static String |
pathToFile(String f)
Enabled: given a filename, strip off the directory prefix (if any) and return it. |
private void |
processArguments(String[] args)
Process the command-line arguments. |
static void |
setArgOK(int i)
Enabled: |
static void |
setFileLineFormatter(FileLineFormatter formatter)
Enabled: |
void |
setNameSpace(String name)
Enabled: Support C++ namespaces (for now). |
static void |
setOutputDirectory(String o)
Enabled: |
static String |
stripBack(String s,
char c)
Enabled: General-purpose utility function for removing characters from back of string |
static String |
stripBack(String s,
String remove)
Enabled: General-purpose utility function for removing characters from back of string |
static String |
stripFront(String s,
char c)
Enabled: General-purpose utility function for removing characters from front of string |
static String |
stripFront(String s,
String remove)
Enabled: General-purpose utility function for removing characters from front of string |
static String |
stripFrontBack(String src,
String head,
String tail)
Enabled: General-purpose utility function for removing characters from the front and back of string |
static void |
toolError(String s)
Enabled: Issue an error; used for general tool errors not for grammar stuff |
static void |
warning(String s)
Enabled: Issue a warning |
static void |
warning(String[] s,
String file,
int line)
Enabled: Issue a warning with line number information |
static void |
warning(String s,
String file,
int line)
Enabled: Issue a warning with line number information |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String version
ToolErrorHandler errorHandler
protected boolean hasError
boolean genDiagnostics
boolean genHTML
protected static String outputDir
String grammarFile
transient Reader f
protected static String literalsPrefix
protected static boolean upperCaseMangledLiterals
protected static NameSpace nameSpace
protected static String namespaceAntlr
protected static String namespaceStd
protected static boolean genHashLines
private static BitSet cmdLineArgValid
Constructor Detail |
public Tool()
Method Detail |
public static void setFileLineFormatter(FileLineFormatter formatter)
private static void checkForInvalidArguments(String[] args, BitSet cmdLineArgValid)
public static void copyFile(String source_name, String dest_name) throws IOException
IOException
protected void doEverything(String[] args)
public void error(String s)
s
- The messagepublic void error(String s, String file, int line)
s
- The messagefile
- The file that has the errorline
- The grammar file line number on which the error occuredpublic static Object factory(String p)
public static String fileMinusPath(String f)
public String getLanguage(MakeGrammar behavior)
public static String getOutputDirectory()
private static void help()
public static void main(String[] args)
public static PrintWriter openOutputFile(String f) throws IOException
IOException
public Reader getGrammarReader()
public static void panic()
public static void panic(String s)
s
- The messagepublic static File parent(File f)
public static Vector parseSeparatedList(String list, char separator)
public static String pathToFile(String f)
private void processArguments(String[] args)
args
- The command-line arguments passed to main()public static void setArgOK(int i)
public static void setOutputDirectory(String o)
public static String stripBack(String s, char c)
s
- The string to processc
- The character to remove
public static String stripBack(String s, String remove)
s
- The string to processremove
- A string containing the set of characters to remove
public static String stripFront(String s, char c)
s
- The string to processc
- The character to remove
public static String stripFront(String s, String remove)
s
- The string to processremove
- A string containing the set of characters to remove
public static String stripFrontBack(String src, String head, String tail)
head
- exact string to strip from headtail
- exact string to strip from tail
public static void toolError(String s)
s
- The messagepublic static void warning(String s)
s
- the messagepublic static void warning(String s, String file, int line)
s
- The messagefile
- The file that has the warningline
- The grammar file line number on which the warning occuredpublic static void warning(String[] s, String file, int line)
s
- The lines of the messagefile
- The file that has the warningline
- The grammar file line number on which the warning occuredpublic void setNameSpace(String name)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |