com.legstar.cobol
Class CobolStructureParserImpl

java.lang.Object
  extended by org.antlr.runtime.BaseRecognizer
      extended by org.antlr.runtime.Parser
          extended by com.legstar.cobol.CobolStructureParser
              extended by com.legstar.cobol.CobolStructureParserImpl

public class CobolStructureParserImpl
extends CobolStructureParser

Overrides some of the ANTLR generated parser methods so that the resulting java class behaves like other LegStar classes, particularly for logging purposes.

This code could be imbedded in the parser grammar as well but its harder to debug using ANTLRWorks because this code might have dependencies on jars which are not naturally in ANTLRWorks classpath.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.legstar.cobol.CobolStructureParser
CobolStructureParser.blank_when_zero_clause_return, CobolStructureParser.clauses_return, CobolStructureParser.cobdata_return, CobolStructureParser.condition_description_entry_return, CobolStructureParser.condition_level_return, CobolStructureParser.condition_name_value_return, CobolStructureParser.condition_name_values_return, CobolStructureParser.data_description_entry_return, CobolStructureParser.data_entry_return, CobolStructureParser.data_item_level_return, CobolStructureParser.data_items_return, CobolStructureParser.date_format_clause_return, CobolStructureParser.decimal_literal_return, CobolStructureParser.external_clause_return, CobolStructureParser.fixed_length_table_return, CobolStructureParser.float_literal_return, CobolStructureParser.global_clause_return, CobolStructureParser.group_usage_clause_return, CobolStructureParser.index_clause_return, CobolStructureParser.justified_clause_return, CobolStructureParser.key_clause_return, CobolStructureParser.literal_return, CobolStructureParser.low_bound_return, CobolStructureParser.occurs_clause_return, CobolStructureParser.picture_clause_return, CobolStructureParser.picture_string_return, CobolStructureParser.redefines_clause_return, CobolStructureParser.rename_description_entry_return, CobolStructureParser.rename_level_return, CobolStructureParser.separate_clause_return, CobolStructureParser.sign_clause_return, CobolStructureParser.sign_leading_clause_return, CobolStructureParser.sign_trailing_clause_return, CobolStructureParser.synchronized_clause_return, CobolStructureParser.usage_clause_return, CobolStructureParser.value_clause_return, CobolStructureParser.variable_length_table_return
 
Field Summary
 
Fields inherited from class com.legstar.cobol.CobolStructureParser
adaptor, ALL_CONSTANT, ALPHANUM_LITERAL_FRAGMENT, ALPHANUM_LITERAL_STRING, APOST, ARE_KEYWORD, ASCENDING_KEYWORD, BINARY, BINARY_KEYWORD, BLANK_KEYWORD, BLANKWHENZERO, BY_KEYWORD, CHARACTER_KEYWORD, CONDITION, CONDITION_LEVEL, CONTINUATION_CHAR, CONTINUED_ALPHANUM_LITERAL_FRAGMENT, DATA_ITEM, DATA_ITEM_LEVEL, DATA_NAME, DATE_FORMAT_KEYWORD, DATE_KEYWORD, DATE_PATTERN, DATEFORMAT, DBCS_LITERAL_STRING, DECIMAL_LITERAL, DECIMAL_POINT, DEPENDING_KEYWORD, DEPENDINGON, DESCENDING_KEYWORD, dfa17, dfa8, DISPLAY, DISPLAY_1_KEYWORD, DISPLAY_KEYWORD, DISPLAY1, DOUBLE_FLOAT_KEYWORD, DOUBLEFLOAT, EOF, EXTERNAL, EXTERNAL_KEYWORD, FIXEDARRAY, FLOAT_LITERAL, FLOAT_PART2, FOLLOW_ALL_CONSTANT_in_literal2147, FOLLOW_ALPHANUM_LITERAL_STRING_in_literal2037, FOLLOW_ASCENDING_KEYWORD_in_key_clause2484, FOLLOW_BINARY_KEYWORD_in_usage_clause1628, FOLLOW_BLANK_KEYWORD_in_blank_when_zero_clause1150, FOLLOW_blank_when_zero_clause_in_clauses988, FOLLOW_clauses_in_data_description_entry525, FOLLOW_condition_description_entry_in_data_entry498, FOLLOW_condition_level_in_condition_description_entry746, FOLLOW_CONDITION_LEVEL_in_condition_level791, FOLLOW_condition_name_value_in_condition_name_values826, FOLLOW_condition_name_values_in_condition_description_entry750, FOLLOW_data_description_entry_in_data_entry478, FOLLOW_data_entry_in_data_items439, FOLLOW_data_item_level_in_data_description_entry520, FOLLOW_DATA_ITEM_LEVEL_in_data_item_level569, FOLLOW_data_items_in_cobdata401, FOLLOW_DATA_NAME_in_condition_description_entry748, FOLLOW_DATA_NAME_in_data_description_entry522, FOLLOW_DATA_NAME_in_index_clause2535, FOLLOW_DATA_NAME_in_key_clause2496, FOLLOW_DATA_NAME_in_redefines_clause1120, FOLLOW_DATA_NAME_in_rename_description_entry605, FOLLOW_DATA_NAME_in_rename_description_entry611, FOLLOW_DATA_NAME_in_rename_description_entry617, FOLLOW_DATA_NAME_in_rename_description_entry661, FOLLOW_DATA_NAME_in_rename_description_entry667, FOLLOW_DATA_NAME_in_variable_length_table2323, FOLLOW_DATA_NAME_in_variable_length_table2379, FOLLOW_date_format_clause_in_clauses1098, FOLLOW_DATE_FORMAT_KEYWORD_in_date_format_clause2204, FOLLOW_DATE_PATTERN_in_date_format_clause2206, FOLLOW_DBCS_LITERAL_STRING_in_literal2067, FOLLOW_decimal_literal_in_literal2007, FOLLOW_decimal_literal_in_synpred2_CobolStructureParser2003, FOLLOW_DECIMAL_POINT_in_decimal_literal2641, FOLLOW_DECIMAL_POINT_in_float_literal2694, FOLLOW_DECIMAL_POINT_in_picture_string2586, FOLLOW_DEPENDING_KEYWORD_in_variable_length_table2321, FOLLOW_DEPENDING_KEYWORD_in_variable_length_table2377, FOLLOW_DESCENDING_KEYWORD_in_key_clause2490, FOLLOW_DISPLAY_1_KEYWORD_in_usage_clause1780, FOLLOW_DISPLAY_KEYWORD_in_usage_clause1751, FOLLOW_DOUBLE_FLOAT_KEYWORD_in_usage_clause1682, FOLLOW_EOF_in_cobdata405, FOLLOW_external_clause_in_clauses998, FOLLOW_EXTERNAL_KEYWORD_in_external_clause1180, FOLLOW_fixed_length_table_in_occurs_clause1297, FOLLOW_float_literal_in_literal1992, FOLLOW_float_literal_in_synpred1_CobolStructureParser1988, FOLLOW_FLOAT_PART2_in_float_literal2698, FOLLOW_FUNCTION_POINTER_KEYWORD_in_usage_clause1914, FOLLOW_global_clause_in_clauses1008, FOLLOW_GLOBAL_KEYWORD_in_global_clause1208, FOLLOW_group_usage_clause_in_clauses1018, FOLLOW_GROUP_USAGE_KEYWORD_in_group_usage_clause1236, FOLLOW_HEX_LITERAL_STRING_in_literal2047, FOLLOW_HIGH_VALUE_CONSTANT_in_literal2117, FOLLOW_index_clause_in_fixed_length_table2250, FOLLOW_index_clause_in_variable_length_table2331, FOLLOW_index_clause_in_variable_length_table2387, FOLLOW_INDEX_KEYWORD_in_usage_clause1807, FOLLOW_INDEXED_KEYWORD_in_index_clause2533, FOLLOW_INT_in_decimal_literal2638, FOLLOW_INT_in_decimal_literal2645, FOLLOW_INT_in_fixed_length_table2242, FOLLOW_INT_in_float_literal2691, FOLLOW_INT_in_literal2017, FOLLOW_INT_in_low_bound2439, FOLLOW_INT_in_variable_length_table2319, FOLLOW_INT_in_variable_length_table2375, FOLLOW_justified_clause_in_clauses1028, FOLLOW_JUSTIFIED_KEYWORD_in_justified_clause1266, FOLLOW_key_clause_in_fixed_length_table2245, FOLLOW_key_clause_in_variable_length_table2326, FOLLOW_key_clause_in_variable_length_table2382, FOLLOW_KEY_KEYWORD_in_key_clause2493, FOLLOW_LEFT_KEYWORD_in_synchronized_clause1517, FOLLOW_literal_in_condition_name_value864, FOLLOW_literal_in_condition_name_value890, FOLLOW_literal_in_value_clause1953, FOLLOW_low_bound_in_synpred3_CobolStructureParser2310, FOLLOW_low_bound_in_variable_length_table2315, FOLLOW_LOW_VALUE_CONSTANT_in_literal2127, FOLLOW_NATIONAL_HEX_LITERAL_STRING_in_literal2087, FOLLOW_NATIONAL_KEYWORD_in_group_usage_clause1238, FOLLOW_NATIONAL_KEYWORD_in_usage_clause1838, FOLLOW_NATIONAL_LITERAL_STRING_in_literal2077, FOLLOW_NATIVE_BINARY_KEYWORD_in_usage_clause1728, FOLLOW_NULL_CONSTANT_in_literal2185, FOLLOW_occurs_clause_in_clauses1038, FOLLOW_OCCURS_KEYWORD_in_fixed_length_table2240, FOLLOW_OCCURS_KEYWORD_in_synpred3_CobolStructureParser2308, FOLLOW_OCCURS_KEYWORD_in_variable_length_table2313, FOLLOW_OCCURS_KEYWORD_in_variable_length_table2373, FOLLOW_PACKED_DECIMAL_KEYWORD_in_usage_clause1706, FOLLOW_PERIOD_in_condition_description_entry752, FOLLOW_PERIOD_in_data_description_entry528, FOLLOW_PERIOD_in_rename_description_entry619, FOLLOW_PERIOD_in_rename_description_entry669, FOLLOW_picture_clause_in_clauses1048, FOLLOW_PICTURE_KEYWORD_in_picture_clause1326, FOLLOW_PICTURE_PART_in_picture_string2580, FOLLOW_picture_string_in_picture_clause1328, FOLLOW_POINTER_KEYWORD_in_usage_clause1866, FOLLOW_PROCEDURE_POINTER_KEYWORD_in_usage_clause1895, FOLLOW_QUOTE_CONSTANT_in_literal2137, FOLLOW_redefines_clause_in_clauses978, FOLLOW_REDEFINES_KEYWORD_in_redefines_clause1118, FOLLOW_rename_description_entry_in_data_entry488, FOLLOW_rename_level_in_rename_description_entry601, FOLLOW_rename_level_in_rename_description_entry657, FOLLOW_RENAMES_KEYWORD_in_rename_description_entry607, FOLLOW_RENAMES_KEYWORD_in_rename_description_entry663, FOLLOW_RENAMES_LEVEL_in_rename_level714, FOLLOW_RIGHT_KEYWORD_in_justified_clause1268, FOLLOW_RIGHT_KEYWORD_in_synchronized_clause1537, FOLLOW_separate_clause_in_sign_leading_clause1404, FOLLOW_separate_clause_in_sign_trailing_clause1442, FOLLOW_SEPARATE_KEYWORD_in_separate_clause1478, FOLLOW_set_in_literal2149, FOLLOW_sign_clause_in_clauses1058, FOLLOW_sign_leading_clause_in_sign_clause1359, FOLLOW_SIGN_LEADING_KEYWORD_in_sign_leading_clause1402, FOLLOW_sign_trailing_clause_in_sign_clause1363, FOLLOW_SIGN_TRAILING_KEYWORD_in_sign_trailing_clause1440, FOLLOW_SIGNED_INT_in_decimal_literal2632, FOLLOW_SIGNED_INT_in_float_literal2685, FOLLOW_SIGNED_INT_in_literal2027, FOLLOW_SINGLE_FLOAT_KEYWORD_in_usage_clause1658, FOLLOW_SPACE_CONSTANT_in_literal2107, FOLLOW_synchronized_clause_in_clauses1068, FOLLOW_SYNCHRONIZED_KEYWORD_in_synchronized_clause1506, FOLLOW_THROUGH_KEYWORD_in_condition_name_value886, FOLLOW_THROUGH_KEYWORD_in_rename_description_entry613, FOLLOW_TO_KEYWORD_in_low_bound2441, FOLLOW_usage_clause_in_clauses1078, FOLLOW_USAGE_KEYWORD_in_usage_clause1604, FOLLOW_value_clause_in_clauses1088, FOLLOW_VALUE_KEYWORD_in_condition_name_values821, FOLLOW_VALUE_KEYWORD_in_value_clause1951, FOLLOW_variable_length_table_in_occurs_clause1307, FOLLOW_ZERO_CONSTANT_in_blank_when_zero_clause1152, FOLLOW_ZERO_CONSTANT_in_literal2097, FOLLOW_ZERO_LITERAL_STRING_in_literal2057, FUNCTION_POINTER_KEYWORD, FUNCTIONPOINTER, GLOBAL, GLOBAL_KEYWORD, GROUP_USAGE_KEYWORD, GROUPUSAGENATIONAL, HBOUND, HEX_LITERAL_STRING, HIGH_VALUE_CONSTANT, INDEX, INDEX_KEYWORD, INDEXED_KEYWORD, INT, IS_KEYWORD, JUSTIFIED_KEYWORD, JUSTIFIEDRIGHT, KEY, KEY_KEYWORD, LBOUND, LEADING, LEFT, LEFT_KEYWORD, LETTER, LEVEL, LITERAL, LOW_VALUE_CONSTANT, NAME, NATIONAL, NATIONAL_HEX_LITERAL_STRING, NATIONAL_KEYWORD, NATIONAL_LITERAL_STRING, NATIVE_BINARY_KEYWORD, NATIVEBINARY, NEWLINE, NULL_CONSTANT, OCCURS_KEYWORD, ON_KEYWORD, PACKED_DECIMAL_KEYWORD, PACKEDDECIMAL, PERIOD, PICTURE, PICTURE_CHAR, PICTURE_KEYWORD, PICTURE_PART, PICTURESTRING, POINTER, POINTER_KEYWORD, PROCEDURE_POINTER_KEYWORD, PROCEDUREPOINTER, QUOTE, QUOTE_CONSTANT, RANGE, REDEFINES, REDEFINES_KEYWORD, RENAME, RENAMES_KEYWORD, RENAMES_LEVEL, RIGHT, RIGHT_KEYWORD, SEPARATE, SEPARATE_KEYWORD, SIGN, SIGN_KEYWORD, SIGN_LEADING_KEYWORD, SIGN_TRAILING_KEYWORD, SIGNED_INT, SINGLE_FLOAT_KEYWORD, SINGLEFLOAT, SPACE, SPACE_CONSTANT, SYNCHRONIZED, SYNCHRONIZED_KEYWORD, THROUGH_KEYWORD, TIMES_KEYWORD, TO_KEYWORD, tokenNames, TRAILING, USAGE, USAGE_KEYWORD, VALUE, VALUE_KEYWORD, VARARRAY, WHEN_KEYWORD, WHITESPACE, ZERO_CONSTANT, ZERO_LITERAL_STRING
 
Fields inherited from class org.antlr.runtime.Parser
input
 
Fields inherited from class org.antlr.runtime.BaseRecognizer
DEFAULT_TOKEN_CHANNEL, HIDDEN, INITIAL_FOLLOW_STACK_SIZE, MEMO_RULE_FAILED, MEMO_RULE_UNKNOWN, NEXT_TOKEN_RULE_NAME, state
 
Constructor Summary
CobolStructureParserImpl(org.antlr.runtime.TokenStream input, RecognizerErrorHandler errorHandler)
          Construct from a token stream.
CobolStructureParserImpl(org.antlr.runtime.TokenStream input, org.antlr.runtime.RecognizerSharedState state, RecognizerErrorHandler errorHandler)
          Construct from a token stream and a shared state.
 
Method Summary
 void emitErrorMessage(String msg)
          
 RecognizerErrorHandler getErrorHandler()
           
 String getErrorMessage(org.antlr.runtime.RecognitionException e, String[] tokenNames)
          
 
Methods inherited from class com.legstar.cobol.CobolStructureParser
blank_when_zero_clause, clauses, cobdata, condition_description_entry, condition_level, condition_name_value, condition_name_values, data_description_entry, data_entry, data_item_level, data_items, date_format_clause, decimal_literal, external_clause, fixed_length_table, float_literal, getGrammarFileName, getLevel, getParent, getTokenNames, getTreeAdaptor, global_clause, group_usage_clause, index_clause, inRange, justified_clause, key_clause, literal, low_bound, occurs_clause, picture_clause, picture_string, redefines_clause, rename_description_entry, rename_level, separate_clause, setTreeAdaptor, sign_clause, sign_leading_clause, sign_trailing_clause, synchronized_clause, synpred1_CobolStructureParser_fragment, synpred1_CobolStructureParser, synpred2_CobolStructureParser_fragment, synpred2_CobolStructureParser, synpred3_CobolStructureParser_fragment, synpred3_CobolStructureParser, unbalancedParentheses, usage_clause, value_clause, variable_length_table
 
Methods inherited from class org.antlr.runtime.Parser
getCurrentInputSymbol, getMissingSymbol, getSourceName, getTokenStream, reset, setTokenStream, traceIn, traceOut
 
Methods inherited from class org.antlr.runtime.BaseRecognizer
alreadyParsedRule, beginResync, combineFollows, computeContextSensitiveRuleFOLLOW, computeErrorRecoverySet, consumeUntil, consumeUntil, displayRecognitionError, endResync, failed, getBacktrackingLevel, getErrorHeader, getNumberOfSyntaxErrors, getRuleInvocationStack, getRuleInvocationStack, getRuleMemoization, getRuleMemoizationCacheSize, getTokenErrorDisplay, match, matchAny, memoize, mismatchIsMissingToken, mismatchIsUnwantedToken, pushFollow, recover, recoverFromMismatchedSet, recoverFromMismatchedToken, reportError, setBacktrackingLevel, toStrings, traceIn, traceOut
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CobolStructureParserImpl

public CobolStructureParserImpl(org.antlr.runtime.TokenStream input,
                                RecognizerErrorHandler errorHandler)
Construct from a token stream.

Parameters:
input - the token stream
errorHandler - handles error messages

CobolStructureParserImpl

public CobolStructureParserImpl(org.antlr.runtime.TokenStream input,
                                org.antlr.runtime.RecognizerSharedState state,
                                RecognizerErrorHandler errorHandler)
Construct from a token stream and a shared state.

Parameters:
input - the token stream
state - the shared state
errorHandler - handles error messages
Method Detail

getErrorMessage

public String getErrorMessage(org.antlr.runtime.RecognitionException e,
                              String[] tokenNames)

Overrides:
getErrorMessage in class org.antlr.runtime.BaseRecognizer

emitErrorMessage

public void emitErrorMessage(String msg)

Overrides:
emitErrorMessage in class org.antlr.runtime.BaseRecognizer

getErrorHandler

public RecognizerErrorHandler getErrorHandler()
Returns:
the error messages handler


Copyright © 2015 LegSem. All rights reserved.