Java Doc for ErrorManager.java in  » Parser » antlr-3.0.1 » org » antlr » tool » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Parser » antlr 3.0.1 » org.antlr.tool 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.antlr.tool.ErrorManager

ErrorManager
public class ErrorManager (Code)
Defines all the errors ANTLR can generator for both the tool and for issues with a grammar. Here is a list of language names: http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt Here is a list of country names: http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html I use constants not strings to identify messages as the compiler will find any errors/mismatches rather than leaving a mistyped string in the code to be found randomly in the future. Further, Intellij can do field name expansion to save me some typing. I have to map int constants to template names, however, which could introduce a mismatch. Someone could provide a .stg file that had a template name wrong. When I load the group, then, I must verify that all messages are there. This is essentially the functionality of the resource bundle stuff Java has, but I don't want to load a property file--I want to load a template group file and this is so simple, why mess with their junk. I use the default Locale as defined by java to compute a group file name in the org/antlr/tool/templates/messages dir called en_US.stg and so on. Normally we want to use the default locale, but often a message file will not exist for it so we must fall back on the US local. During initialization of this class, all errors go straight to System.err. There is no way around this. If I have not set up the error system, how can I do errors properly? For example, if the string template group file full of messages has an error, how could I print to anything but System.err? TODO: how to map locale to a file encoding for the stringtemplate group file? StringTemplate knows how to pay attention to the default encoding so it should probably just work unless a GUI sets the local to some chinese variation but System.getProperty("file.encoding") is US. Hmm... TODO: get antlr.g etc.. parsing errors to come here.

Inner Class :static class ErrorState

Field Summary
final public static  BitSetERRORS_FORCING_NO_ANALYSIS
    
final public static  BitSetERRORS_FORCING_NO_CODEGEN
    
final public static  intMAX_MESSAGE_NUMBER
    
final public static  intMSG_ACTION_REDEFINITION
    
final public static  intMSG_AMBIGUOUS_RULE_SCOPE
    
final public static  intMSG_ANALYSIS_ABORTED
    
final public static  intMSG_ARGS_ON_TOKEN_REF
    
final public static  intMSG_ARG_INIT_VALUES_ILLEGAL
    
final public static  intMSG_ARG_RETVAL_CONFLICT
    
final public static  intMSG_ATTRIBUTE_CONFLICTS_WITH_RULE
    
final public static  intMSG_ATTRIBUTE_CONFLICTS_WITH_RULE_ARG_RETVAL
    
final public static  intMSG_ATTRIBUTE_REF_NOT_IN_RULE
    
final public static  intMSG_BAD_ACTION_AST_STRUCTURE
    
final public static  intMSG_BAD_AST_STRUCTURE
    
final public static  intMSG_CANNOT_ALIAS_TOKENS_IN_LEXER
    
final public static  intMSG_CANNOT_CLOSE_FILE
    
final public static  intMSG_CANNOT_CREATE_TARGET_GENERATOR
    
final public static  intMSG_CANNOT_FIND_ATTRIBUTE_NAME_IN_DECL
    
final public static  intMSG_CANNOT_FIND_TOKENS_FILE
    
final public static  intMSG_CANNOT_GEN_DOT_FILE
    
final public static  intMSG_CANNOT_OPEN_FILE
    
final public static  intMSG_CANNOT_WRITE_FILE
    
final public static  intMSG_CODE_GEN_TEMPLATES_INCOMPLETE
    
final public static  intMSG_DANGLING_STATE
    
final public static  intMSG_DIR_NOT_FOUND
    
final public static  intMSG_DOUBLE_QUOTES_ILLEGAL
    
final public static  intMSG_DUPLICATE_SET_ENTRY
    
final public static  intMSG_EMPTY_COMPLEMENT
    
final public static  intMSG_ERROR_CREATING_ARTIFICIAL_RULE
    
final public static  intMSG_ERROR_READING_TOKENS_FILE
    
final public static  intMSG_FILENAME_EXTENSION_ERROR
    
final public static  intMSG_FILE_AND_GRAMMAR_NAME_DIFFER
    
final public static  intMSG_FORWARD_ELEMENT_REF
    
final public static  intMSG_GRAMMAR_NONDETERMINISM
    
final public static  intMSG_ILLEGAL_OPTION
    
final public static  intMSG_INSUFFICIENT_PREDICATES
    
final public static  intMSG_INTERNAL_ERROR
    
final public static  intMSG_INTERNAL_WARNING
    
final public static  intMSG_INVALID_ACTION_SCOPE
    
final public static  intMSG_INVALID_RULE_PARAMETER_REF
    
final public static  intMSG_INVALID_RULE_SCOPE_ATTRIBUTE_REF
    
final public static  intMSG_INVALID_TEMPLATE_ACTION
    
final public static  intMSG_ISOLATED_RULE_ATTRIBUTE
    
final public static  intMSG_ISOLATED_RULE_SCOPE
    
final public static  intMSG_LABEL_CONFLICTS_WITH_RULE
    
final public static  intMSG_LABEL_CONFLICTS_WITH_RULE_ARG_RETVAL
    
final public static  intMSG_LABEL_CONFLICTS_WITH_RULE_SCOPE_ATTRIBUTE
    
final public static  intMSG_LABEL_CONFLICTS_WITH_TOKEN
    
final public static  intMSG_LABEL_TYPE_CONFLICT
    
final public static  intMSG_LEFT_RECURSION
    
final public static  intMSG_LEFT_RECURSION_CYCLES
    
final public static  intMSG_LEXER_RULES_NOT_ALLOWED
    
final public static  intMSG_LIST_LABEL_INVALID_UNLESS_RETVAL_STRUCT
    
final public static  intMSG_LITERAL_NOT_ASSOCIATED_WITH_LEXER_RULE
    
final public static  intMSG_MISSING_AST_TYPE_IN_TREE_GRAMMAR
    
final public static  intMSG_MISSING_ATTRIBUTE_NAME
    
final public static  intMSG_MISSING_CODE_GEN_TEMPLATES
    
final public static  intMSG_MISSING_CYCLIC_DFA_CODE_GEN_TEMPLATES
    
final public static  intMSG_MISSING_RULE_ARGS
    
final public static  intMSG_NONREGULAR_DECISION
    
final public static  intMSG_NONUNIQUE_REF
    
final public static  intMSG_NO_GRAMMAR_START_RULE
    
final public static  intMSG_NO_RULES
    
final public static  intMSG_NO_TOKEN_DEFINITION
    
final public static  intMSG_OUTPUT_DIR_IS_FILE
    
final public static  intMSG_PARSER_RULES_NOT_ALLOWED
    
final public static  intMSG_RECURSION_OVERLOW
    
final public static  intMSG_REWRITE_ELEMENT_NOT_PRESENT_ON_LHS
    
final public static  intMSG_REWRITE_FOR_MULTI_ELEMENT_ALT
    
final public static  intMSG_REWRITE_OR_OP_WITH_NO_OUTPUT_OPTION
    
final public static  intMSG_RULE_HAS_NO_ARGS
    
final public static  intMSG_RULE_INVALID_SET
    
final public static  intMSG_RULE_REDEFINITION
    
final public static  intMSG_SYMBOL_CONFLICTS_WITH_GLOBAL_SCOPE
    
final public static  intMSG_SYNTAX_ERROR
    
final public static  intMSG_TOKENS_FILE_SYNTAX_ERROR
    
final public static  intMSG_TOKEN_NONDETERMINISM
    
final public static  intMSG_UNDEFINED_LABEL_REF_IN_REWRITE
    
final public static  intMSG_UNDEFINED_RULE_REF
    
final public static  intMSG_UNDEFINED_TOKEN_REF_IN_REWRITE
    
final public static  intMSG_UNKNOWN_ATTRIBUTE_IN_SCOPE
    
final public static  intMSG_UNKNOWN_DYNAMIC_SCOPE
    
final public static  intMSG_UNKNOWN_DYNAMIC_SCOPE_ATTRIBUTE
    
final public static  intMSG_UNKNOWN_RULE_ATTRIBUTE
    
final public static  intMSG_UNKNOWN_SIMPLE_ATTRIBUTE
    
final public static  intMSG_UNREACHABLE_ALTS
    
final public static  intMSG_UNREACHABLE_TOKENS
    
final public static  intMSG_WRITE_TO_READONLY_ATTR
    
static  StringTemplateErrorListenerblankSTListener
     During verification of the messages group file, don't gen errors. I'll handle them here.
final public static  MapemitSingleError
     Only one error can be emitted for any entry in this table.
static  StringTemplateErrorListenerinitSTListener
     Handle all ST error listeners here (code gen, Grammar, and this class use templates.
static  ANTLRErrorListenertheDefaultErrorListener
    
static  StringTemplateErrorListenertheDefaultSTListener
     Errors during initialization related to ST must all go to System.err.


Method Summary
public static  voidanalysisAborted(DecisionProbe probe)
    
public static  voidassertTrue(boolean condition, String message)
    
public static  voiddanglingState(DecisionProbe probe, DFAState d)
    
public static  booleandoNotAttemptAnalysis()
    
public static  booleandoNotAttemptCodeGen()
    
public static  voiderror(int msgID)
    
public static  voiderror(int msgID, Throwable e)
    
public static  voiderror(int msgID, Object arg)
    
public static  voiderror(int msgID, Object arg, Object arg2)
    
public static  voiderror(int msgID, Object arg, Throwable e)
    
public static  booleanformatWantsSingleLineMessage()
    
public static  ANTLRErrorListenergetErrorListener()
    
public static  ErrorStategetErrorState()
    
public static  StringTemplategetLocationFormat()
     Return a StringTemplate that refers to the current format used for emitting messages.
public static  StringTemplategetMessage(int msgID)
     Given a message ID, return a StringTemplate that somebody can fill with data.
public static  StringTemplategetMessageFormat()
    
public static  StringgetMessageType(int msgID)
    
public static  StringTemplategetReportFormat()
    
public static  StringTemplateErrorListenergetStringTemplateErrorListener()
    
public static  voidgrammarError(int msgID, Grammar g, Token token, Object arg, Object arg2)
    
public static  voidgrammarError(int msgID, Grammar g, Token token, Object arg)
    
public static  voidgrammarError(int msgID, Grammar g, Token token)
    
public static  voidgrammarWarning(int msgID, Grammar g, Token token, Object arg, Object arg2)
    
public static  voidgrammarWarning(int msgID, Grammar g, Token token, Object arg)
    
public static  voidgrammarWarning(int msgID, Grammar g, Token token)
    
public static  voidinfo(String msg)
    
protected static  booleaninitIdToMessageNameMapping()
    
public static  voidinsufficientPredicates(DecisionProbe probe, List alts)
    
public static  voidinternalError(Object error, Throwable e)
    
public static  voidinternalError(Object error)
    
public static  voidleftRecursionCycles(Collection cycles)
    
public static  voidnonLLStarDecision(DecisionProbe probe)
    
public static  voidnondeterminism(DecisionProbe probe, DFAState d)
    
public static  voidpanic()
     I *think* this will allow Tool subclasses to exit gracefully for GUIs etc...
static  voidrawError(String msg)
     If there are errors during ErrorManager init, we have no choice but to go to System.err.
static  voidrawError(String msg, Throwable e)
    
public static  voidrecursionOverflow(DecisionProbe probe, DFAState sampleBadState, int alt, Collection targetRules, Collection callSiteStates)
    
public static  voidresetErrorState()
    
public static  voidsetErrorListener(ANTLRErrorListener listener)
     In general, you'll want all errors to go to a single spot. However, in a GUI, you might have two frames up with two different grammars.
public static  voidsetFormat(String formatName)
     The format gets reset either from the Tool if the user supplied a command line option to that effect Otherwise we just use the default "antlr".
public static  voidsetLocale(Locale locale)
     We really only need a single locale for entire running ANTLR code in a single VM.
public static  voidsetTool(Tool tool)
    
public static  voidsyntaxError(int msgID, Grammar grammar, Token token, Object arg, antlr.RecognitionException re)
    
public static  voidunreachableAlts(DecisionProbe probe, List alts)
    
protected static  booleanverifyFormat()
    
protected static  booleanverifyMessages()
     Use reflection to find list of MSG_ fields and then verify a template exists for each one from the locale's group.
public static  voidwarning(int msgID, Object arg)
    

Field Detail
ERRORS_FORCING_NO_ANALYSIS
final public static BitSet ERRORS_FORCING_NO_ANALYSIS(Code)
Do not do perform analysis and code gen if one of these happens



ERRORS_FORCING_NO_CODEGEN
final public static BitSet ERRORS_FORCING_NO_CODEGEN(Code)
Do not do perform analysis and code gen if one of these happens



MAX_MESSAGE_NUMBER
final public static int MAX_MESSAGE_NUMBER(Code)



MSG_ACTION_REDEFINITION
final public static int MSG_ACTION_REDEFINITION(Code)



MSG_AMBIGUOUS_RULE_SCOPE
final public static int MSG_AMBIGUOUS_RULE_SCOPE(Code)



MSG_ANALYSIS_ABORTED
final public static int MSG_ANALYSIS_ABORTED(Code)



MSG_ARGS_ON_TOKEN_REF
final public static int MSG_ARGS_ON_TOKEN_REF(Code)



MSG_ARG_INIT_VALUES_ILLEGAL
final public static int MSG_ARG_INIT_VALUES_ILLEGAL(Code)



MSG_ARG_RETVAL_CONFLICT
final public static int MSG_ARG_RETVAL_CONFLICT(Code)



MSG_ATTRIBUTE_CONFLICTS_WITH_RULE
final public static int MSG_ATTRIBUTE_CONFLICTS_WITH_RULE(Code)



MSG_ATTRIBUTE_CONFLICTS_WITH_RULE_ARG_RETVAL
final public static int MSG_ATTRIBUTE_CONFLICTS_WITH_RULE_ARG_RETVAL(Code)



MSG_ATTRIBUTE_REF_NOT_IN_RULE
final public static int MSG_ATTRIBUTE_REF_NOT_IN_RULE(Code)



MSG_BAD_ACTION_AST_STRUCTURE
final public static int MSG_BAD_ACTION_AST_STRUCTURE(Code)



MSG_BAD_AST_STRUCTURE
final public static int MSG_BAD_AST_STRUCTURE(Code)



MSG_CANNOT_ALIAS_TOKENS_IN_LEXER
final public static int MSG_CANNOT_ALIAS_TOKENS_IN_LEXER(Code)



MSG_CANNOT_CLOSE_FILE
final public static int MSG_CANNOT_CLOSE_FILE(Code)



MSG_CANNOT_CREATE_TARGET_GENERATOR
final public static int MSG_CANNOT_CREATE_TARGET_GENERATOR(Code)



MSG_CANNOT_FIND_ATTRIBUTE_NAME_IN_DECL
final public static int MSG_CANNOT_FIND_ATTRIBUTE_NAME_IN_DECL(Code)



MSG_CANNOT_FIND_TOKENS_FILE
final public static int MSG_CANNOT_FIND_TOKENS_FILE(Code)



MSG_CANNOT_GEN_DOT_FILE
final public static int MSG_CANNOT_GEN_DOT_FILE(Code)



MSG_CANNOT_OPEN_FILE
final public static int MSG_CANNOT_OPEN_FILE(Code)



MSG_CANNOT_WRITE_FILE
final public static int MSG_CANNOT_WRITE_FILE(Code)



MSG_CODE_GEN_TEMPLATES_INCOMPLETE
final public static int MSG_CODE_GEN_TEMPLATES_INCOMPLETE(Code)



MSG_DANGLING_STATE
final public static int MSG_DANGLING_STATE(Code)



MSG_DIR_NOT_FOUND
final public static int MSG_DIR_NOT_FOUND(Code)



MSG_DOUBLE_QUOTES_ILLEGAL
final public static int MSG_DOUBLE_QUOTES_ILLEGAL(Code)



MSG_DUPLICATE_SET_ENTRY
final public static int MSG_DUPLICATE_SET_ENTRY(Code)



MSG_EMPTY_COMPLEMENT
final public static int MSG_EMPTY_COMPLEMENT(Code)



MSG_ERROR_CREATING_ARTIFICIAL_RULE
final public static int MSG_ERROR_CREATING_ARTIFICIAL_RULE(Code)



MSG_ERROR_READING_TOKENS_FILE
final public static int MSG_ERROR_READING_TOKENS_FILE(Code)



MSG_FILENAME_EXTENSION_ERROR
final public static int MSG_FILENAME_EXTENSION_ERROR(Code)



MSG_FILE_AND_GRAMMAR_NAME_DIFFER
final public static int MSG_FILE_AND_GRAMMAR_NAME_DIFFER(Code)



MSG_FORWARD_ELEMENT_REF
final public static int MSG_FORWARD_ELEMENT_REF(Code)



MSG_GRAMMAR_NONDETERMINISM
final public static int MSG_GRAMMAR_NONDETERMINISM(Code)



MSG_ILLEGAL_OPTION
final public static int MSG_ILLEGAL_OPTION(Code)



MSG_INSUFFICIENT_PREDICATES
final public static int MSG_INSUFFICIENT_PREDICATES(Code)



MSG_INTERNAL_ERROR
final public static int MSG_INTERNAL_ERROR(Code)



MSG_INTERNAL_WARNING
final public static int MSG_INTERNAL_WARNING(Code)



MSG_INVALID_ACTION_SCOPE
final public static int MSG_INVALID_ACTION_SCOPE(Code)



MSG_INVALID_RULE_PARAMETER_REF
final public static int MSG_INVALID_RULE_PARAMETER_REF(Code)



MSG_INVALID_RULE_SCOPE_ATTRIBUTE_REF
final public static int MSG_INVALID_RULE_SCOPE_ATTRIBUTE_REF(Code)



MSG_INVALID_TEMPLATE_ACTION
final public static int MSG_INVALID_TEMPLATE_ACTION(Code)



MSG_ISOLATED_RULE_ATTRIBUTE
final public static int MSG_ISOLATED_RULE_ATTRIBUTE(Code)



MSG_ISOLATED_RULE_SCOPE
final public static int MSG_ISOLATED_RULE_SCOPE(Code)



MSG_LABEL_CONFLICTS_WITH_RULE
final public static int MSG_LABEL_CONFLICTS_WITH_RULE(Code)



MSG_LABEL_CONFLICTS_WITH_RULE_ARG_RETVAL
final public static int MSG_LABEL_CONFLICTS_WITH_RULE_ARG_RETVAL(Code)



MSG_LABEL_CONFLICTS_WITH_RULE_SCOPE_ATTRIBUTE
final public static int MSG_LABEL_CONFLICTS_WITH_RULE_SCOPE_ATTRIBUTE(Code)



MSG_LABEL_CONFLICTS_WITH_TOKEN
final public static int MSG_LABEL_CONFLICTS_WITH_TOKEN(Code)



MSG_LABEL_TYPE_CONFLICT
final public static int MSG_LABEL_TYPE_CONFLICT(Code)



MSG_LEFT_RECURSION
final public static int MSG_LEFT_RECURSION(Code)



MSG_LEFT_RECURSION_CYCLES
final public static int MSG_LEFT_RECURSION_CYCLES(Code)



MSG_LEXER_RULES_NOT_ALLOWED
final public static int MSG_LEXER_RULES_NOT_ALLOWED(Code)



MSG_LIST_LABEL_INVALID_UNLESS_RETVAL_STRUCT
final public static int MSG_LIST_LABEL_INVALID_UNLESS_RETVAL_STRUCT(Code)



MSG_LITERAL_NOT_ASSOCIATED_WITH_LEXER_RULE
final public static int MSG_LITERAL_NOT_ASSOCIATED_WITH_LEXER_RULE(Code)



MSG_MISSING_AST_TYPE_IN_TREE_GRAMMAR
final public static int MSG_MISSING_AST_TYPE_IN_TREE_GRAMMAR(Code)



MSG_MISSING_ATTRIBUTE_NAME
final public static int MSG_MISSING_ATTRIBUTE_NAME(Code)



MSG_MISSING_CODE_GEN_TEMPLATES
final public static int MSG_MISSING_CODE_GEN_TEMPLATES(Code)



MSG_MISSING_CYCLIC_DFA_CODE_GEN_TEMPLATES
final public static int MSG_MISSING_CYCLIC_DFA_CODE_GEN_TEMPLATES(Code)



MSG_MISSING_RULE_ARGS
final public static int MSG_MISSING_RULE_ARGS(Code)



MSG_NONREGULAR_DECISION
final public static int MSG_NONREGULAR_DECISION(Code)



MSG_NONUNIQUE_REF
final public static int MSG_NONUNIQUE_REF(Code)



MSG_NO_GRAMMAR_START_RULE
final public static int MSG_NO_GRAMMAR_START_RULE(Code)



MSG_NO_RULES
final public static int MSG_NO_RULES(Code)



MSG_NO_TOKEN_DEFINITION
final public static int MSG_NO_TOKEN_DEFINITION(Code)



MSG_OUTPUT_DIR_IS_FILE
final public static int MSG_OUTPUT_DIR_IS_FILE(Code)



MSG_PARSER_RULES_NOT_ALLOWED
final public static int MSG_PARSER_RULES_NOT_ALLOWED(Code)



MSG_RECURSION_OVERLOW
final public static int MSG_RECURSION_OVERLOW(Code)



MSG_REWRITE_ELEMENT_NOT_PRESENT_ON_LHS
final public static int MSG_REWRITE_ELEMENT_NOT_PRESENT_ON_LHS(Code)



MSG_REWRITE_FOR_MULTI_ELEMENT_ALT
final public static int MSG_REWRITE_FOR_MULTI_ELEMENT_ALT(Code)



MSG_REWRITE_OR_OP_WITH_NO_OUTPUT_OPTION
final public static int MSG_REWRITE_OR_OP_WITH_NO_OUTPUT_OPTION(Code)



MSG_RULE_HAS_NO_ARGS
final public static int MSG_RULE_HAS_NO_ARGS(Code)



MSG_RULE_INVALID_SET
final public static int MSG_RULE_INVALID_SET(Code)



MSG_RULE_REDEFINITION
final public static int MSG_RULE_REDEFINITION(Code)



MSG_SYMBOL_CONFLICTS_WITH_GLOBAL_SCOPE
final public static int MSG_SYMBOL_CONFLICTS_WITH_GLOBAL_SCOPE(Code)



MSG_SYNTAX_ERROR
final public static int MSG_SYNTAX_ERROR(Code)



MSG_TOKENS_FILE_SYNTAX_ERROR
final public static int MSG_TOKENS_FILE_SYNTAX_ERROR(Code)



MSG_TOKEN_NONDETERMINISM
final public static int MSG_TOKEN_NONDETERMINISM(Code)



MSG_UNDEFINED_LABEL_REF_IN_REWRITE
final public static int MSG_UNDEFINED_LABEL_REF_IN_REWRITE(Code)



MSG_UNDEFINED_RULE_REF
final public static int MSG_UNDEFINED_RULE_REF(Code)



MSG_UNDEFINED_TOKEN_REF_IN_REWRITE
final public static int MSG_UNDEFINED_TOKEN_REF_IN_REWRITE(Code)



MSG_UNKNOWN_ATTRIBUTE_IN_SCOPE
final public static int MSG_UNKNOWN_ATTRIBUTE_IN_SCOPE(Code)



MSG_UNKNOWN_DYNAMIC_SCOPE
final public static int MSG_UNKNOWN_DYNAMIC_SCOPE(Code)



MSG_UNKNOWN_DYNAMIC_SCOPE_ATTRIBUTE
final public static int MSG_UNKNOWN_DYNAMIC_SCOPE_ATTRIBUTE(Code)



MSG_UNKNOWN_RULE_ATTRIBUTE
final public static int MSG_UNKNOWN_RULE_ATTRIBUTE(Code)



MSG_UNKNOWN_SIMPLE_ATTRIBUTE
final public static int MSG_UNKNOWN_SIMPLE_ATTRIBUTE(Code)



MSG_UNREACHABLE_ALTS
final public static int MSG_UNREACHABLE_ALTS(Code)



MSG_UNREACHABLE_TOKENS
final public static int MSG_UNREACHABLE_TOKENS(Code)



MSG_WRITE_TO_READONLY_ATTR
final public static int MSG_WRITE_TO_READONLY_ATTR(Code)



blankSTListener
static StringTemplateErrorListener blankSTListener(Code)
During verification of the messages group file, don't gen errors. I'll handle them here. This is used only after file has loaded ok and only for the messages STG.



emitSingleError
final public static Map emitSingleError(Code)
Only one error can be emitted for any entry in this table. Map where the key is a method name like danglingState. The set is whatever that method accepts or derives like a DFA.



initSTListener
static StringTemplateErrorListener initSTListener(Code)
Handle all ST error listeners here (code gen, Grammar, and this class use templates.



theDefaultErrorListener
static ANTLRErrorListener theDefaultErrorListener(Code)



theDefaultSTListener
static StringTemplateErrorListener theDefaultSTListener(Code)
Errors during initialization related to ST must all go to System.err.





Method Detail
analysisAborted
public static void analysisAborted(DecisionProbe probe)(Code)



assertTrue
public static void assertTrue(boolean condition, String message)(Code)



danglingState
public static void danglingState(DecisionProbe probe, DFAState d)(Code)



doNotAttemptAnalysis
public static boolean doNotAttemptAnalysis()(Code)



doNotAttemptCodeGen
public static boolean doNotAttemptCodeGen()(Code)



error
public static void error(int msgID)(Code)



error
public static void error(int msgID, Throwable e)(Code)



error
public static void error(int msgID, Object arg)(Code)



error
public static void error(int msgID, Object arg, Object arg2)(Code)



error
public static void error(int msgID, Object arg, Throwable e)(Code)



formatWantsSingleLineMessage
public static boolean formatWantsSingleLineMessage()(Code)



getErrorListener
public static ANTLRErrorListener getErrorListener()(Code)



getErrorState
public static ErrorState getErrorState()(Code)



getLocationFormat
public static StringTemplate getLocationFormat()(Code)
Return a StringTemplate that refers to the current format used for emitting messages.



getMessage
public static StringTemplate getMessage(int msgID)(Code)
Given a message ID, return a StringTemplate that somebody can fill with data. We need to convert the int ID to the name of a template in the messages ST group.



getMessageFormat
public static StringTemplate getMessageFormat()(Code)



getMessageType
public static String getMessageType(int msgID)(Code)



getReportFormat
public static StringTemplate getReportFormat()(Code)



getStringTemplateErrorListener
public static StringTemplateErrorListener getStringTemplateErrorListener()(Code)



grammarError
public static void grammarError(int msgID, Grammar g, Token token, Object arg, Object arg2)(Code)



grammarError
public static void grammarError(int msgID, Grammar g, Token token, Object arg)(Code)



grammarError
public static void grammarError(int msgID, Grammar g, Token token)(Code)



grammarWarning
public static void grammarWarning(int msgID, Grammar g, Token token, Object arg, Object arg2)(Code)



grammarWarning
public static void grammarWarning(int msgID, Grammar g, Token token, Object arg)(Code)



grammarWarning
public static void grammarWarning(int msgID, Grammar g, Token token)(Code)



info
public static void info(String msg)(Code)



initIdToMessageNameMapping
protected static boolean initIdToMessageNameMapping()(Code)



insufficientPredicates
public static void insufficientPredicates(DecisionProbe probe, List alts)(Code)



internalError
public static void internalError(Object error, Throwable e)(Code)



internalError
public static void internalError(Object error)(Code)



leftRecursionCycles
public static void leftRecursionCycles(Collection cycles)(Code)



nonLLStarDecision
public static void nonLLStarDecision(DecisionProbe probe)(Code)



nondeterminism
public static void nondeterminism(DecisionProbe probe, DFAState d)(Code)



panic
public static void panic()(Code)
I *think* this will allow Tool subclasses to exit gracefully for GUIs etc...



rawError
static void rawError(String msg)(Code)
If there are errors during ErrorManager init, we have no choice but to go to System.err.



rawError
static void rawError(String msg, Throwable e)(Code)



recursionOverflow
public static void recursionOverflow(DecisionProbe probe, DFAState sampleBadState, int alt, Collection targetRules, Collection callSiteStates)(Code)



resetErrorState
public static void resetErrorState()(Code)



setErrorListener
public static void setErrorListener(ANTLRErrorListener listener)(Code)
In general, you'll want all errors to go to a single spot. However, in a GUI, you might have two frames up with two different grammars. Two threads might launch to process the grammars--you would want errors to go to different objects depending on the thread. I store a single listener per thread.



setFormat
public static void setFormat(String formatName)(Code)
The format gets reset either from the Tool if the user supplied a command line option to that effect Otherwise we just use the default "antlr".



setLocale
public static void setLocale(Locale locale)(Code)
We really only need a single locale for entire running ANTLR code in a single VM. Only pay attention to the language, not the country so that French Canadians and French Frenchies all get the same template file, fr.stg. Just easier this way.



setTool
public static void setTool(Tool tool)(Code)



syntaxError
public static void syntaxError(int msgID, Grammar grammar, Token token, Object arg, antlr.RecognitionException re)(Code)



unreachableAlts
public static void unreachableAlts(DecisionProbe probe, List alts)(Code)



verifyFormat
protected static boolean verifyFormat()(Code)
Verify the message format template group



verifyMessages
protected static boolean verifyMessages()(Code)
Use reflection to find list of MSG_ fields and then verify a template exists for each one from the locale's group.



warning
public static void warning(int msgID, Object arg)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.