com.legstar.cobol
Class CobolStructureEmitterImpl

java.lang.Object
  extended by org.antlr.runtime.BaseRecognizer
      extended by org.antlr.runtime.tree.TreeParser
          extended by com.legstar.cobol.CobolStructureEmitter
              extended by com.legstar.cobol.CobolStructureEmitterImpl

public class CobolStructureEmitterImpl
extends CobolStructureEmitter

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

This code could be imbedded in the lexer 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.CobolStructureEmitter
CobolStructureEmitter.data_entry_scope
 
Field Summary
 
Fields inherited from class com.legstar.cobol.CobolStructureEmitter
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_entry_stack, 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, dfa15, DISPLAY, DISPLAY_1_KEYWORD, DISPLAY_KEYWORD, DISPLAY1, DOUBLE_FLOAT_KEYWORD, DOUBLEFLOAT, EOF, EXTERNAL, EXTERNAL_KEYWORD, FIXEDARRAY, FLOAT_LITERAL, FLOAT_PART2, FOLLOW_ALL_CONSTANT_in_literal1763, FOLLOW_ALPHANUM_LITERAL_STRING_in_literal1543, FOLLOW_ALPHANUM_LITERAL_STRING_in_literal1768, FOLLOW_ASCENDING_KEYWORD_in_key_clause2091, FOLLOW_BINARY_in_usage_clause1105, FOLLOW_blank_when_zero_clause_in_clauses546, FOLLOW_BLANKWHENZERO_in_blank_when_zero_clause709, FOLLOW_clauses_in_data_description_entry147, FOLLOW_condition_description_entry_in_data_entry118, FOLLOW_CONDITION_in_condition_description_entry394, FOLLOW_condition_level_in_condition_description_entry396, FOLLOW_CONDITION_LEVEL_in_condition_level431, FOLLOW_condition_subject_literal_in_condition_description_entry401, FOLLOW_condition_subject_range_in_condition_description_entry405, FOLLOW_data_description_entry_in_data_entry98, FOLLOW_data_entry_in_cobdata57, FOLLOW_data_entry_in_data_description_entry151, FOLLOW_DATA_ITEM_in_data_description_entry140, FOLLOW_data_item_level_in_data_description_entry142, FOLLOW_DATA_ITEM_LEVEL_in_data_item_level181, FOLLOW_data_item_name_in_condition_description_entry398, FOLLOW_data_item_name_in_data_description_entry144, FOLLOW_data_item_name_in_rename_description_entry253, FOLLOW_DATA_NAME_in_data_item_name214, FOLLOW_DATA_NAME_in_depending_on2014, FOLLOW_DATA_NAME_in_index_clause2154, FOLLOW_DATA_NAME_in_key_clause2093, FOLLOW_DATA_NAME_in_key_clause2119, FOLLOW_DATA_NAME_in_redefines_clause679, FOLLOW_DATA_NAME_in_rename_subject_literal322, FOLLOW_DATA_NAME_in_rename_subject_range357, FOLLOW_DATA_NAME_in_rename_subject_range361, FOLLOW_date_format_clause_in_clauses656, FOLLOW_DATE_PATTERN_in_date_format_clause1857, FOLLOW_DATEFORMAT_in_date_format_clause1855, FOLLOW_DBCS_LITERAL_STRING_in_literal1603, FOLLOW_DECIMAL_LITERAL_in_literal1483, FOLLOW_depending_on_in_high_bound1976, FOLLOW_DEPENDINGON_in_depending_on2012, FOLLOW_DESCENDING_KEYWORD_in_key_clause2117, FOLLOW_DISPLAY_in_usage_clause1225, FOLLOW_DISPLAY1_in_usage_clause1249, FOLLOW_DOUBLEFLOAT_in_usage_clause1153, FOLLOW_external_clause_in_clauses556, FOLLOW_EXTERNAL_in_external_clause738, FOLLOW_fixed_length_table_in_occurs_clause854, FOLLOW_FIXEDARRAY_in_fixed_length_table1892, FOLLOW_FLOAT_LITERAL_in_literal1463, FOLLOW_FUNCTIONPOINTER_in_usage_clause1369, FOLLOW_global_clause_in_clauses566, FOLLOW_GLOBAL_in_global_clause767, FOLLOW_group_usage_clause_in_clauses576, FOLLOW_GROUPUSAGENATIONAL_in_group_usage_clause796, FOLLOW_HBOUND_in_high_bound1972, FOLLOW_HEX_LITERAL_STRING_in_literal1563, FOLLOW_high_bound_in_fixed_length_table1894, FOLLOW_high_bound_in_variable_length_table1941, FOLLOW_HIGH_VALUE_CONSTANT_in_literal1703, FOLLOW_HIGH_VALUE_CONSTANT_in_literal1786, FOLLOW_index_clause_in_fixed_length_table1899, FOLLOW_index_clause_in_variable_length_table1946, FOLLOW_INDEX_in_index_clause2152, FOLLOW_INDEX_in_usage_clause1273, FOLLOW_INT_in_high_bound1974, FOLLOW_INT_in_literal1503, FOLLOW_INT_in_low_bound2049, FOLLOW_justified_clause_in_clauses586, FOLLOW_JUSTIFIEDRIGHT_in_justified_clause825, FOLLOW_key_clause_in_fixed_length_table1896, FOLLOW_key_clause_in_variable_length_table1943, FOLLOW_KEY_in_key_clause2089, FOLLOW_KEY_in_key_clause2115, FOLLOW_LBOUND_in_low_bound2047, FOLLOW_LEADING_in_sign_leading_clause958, FOLLOW_LEVEL_in_condition_level429, FOLLOW_LEVEL_in_data_item_level179, FOLLOW_LEVEL_in_rename_level287, FOLLOW_LITERAL_in_condition_subject_literal462, FOLLOW_literal_in_condition_subject_literal464, FOLLOW_literal_in_condition_subject_range499, FOLLOW_literal_in_condition_subject_range503, FOLLOW_LITERAL_in_rename_subject_literal320, FOLLOW_literal_in_value_clause_literal1426, FOLLOW_low_bound_in_variable_length_table1938, FOLLOW_LOW_VALUE_CONSTANT_in_literal1723, FOLLOW_LOW_VALUE_CONSTANT_in_literal1792, FOLLOW_NAME_in_data_item_name212, FOLLOW_NATIONAL_HEX_LITERAL_STRING_in_literal1643, FOLLOW_NATIONAL_in_usage_clause1297, FOLLOW_NATIONAL_LITERAL_STRING_in_literal1623, FOLLOW_NATIVEBINARY_in_usage_clause1201, FOLLOW_NULL_CONSTANT_in_literal1804, FOLLOW_NULL_CONSTANT_in_literal1825, FOLLOW_occurs_clause_in_clauses596, FOLLOW_PACKEDDECIMAL_in_usage_clause1177, FOLLOW_picture_clause_in_clauses606, FOLLOW_PICTURE_in_picture_clause884, FOLLOW_PICTURESTRING_in_picture_clause886, FOLLOW_POINTER_in_usage_clause1321, FOLLOW_PROCEDUREPOINTER_in_usage_clause1345, FOLLOW_QUOTE_CONSTANT_in_literal1743, FOLLOW_QUOTE_CONSTANT_in_literal1798, FOLLOW_RANGE_in_condition_subject_range495, FOLLOW_RANGE_in_rename_subject_range353, FOLLOW_redefines_clause_in_clauses536, FOLLOW_REDEFINES_in_redefines_clause677, FOLLOW_rename_description_entry_in_data_entry108, FOLLOW_RENAME_in_rename_description_entry249, FOLLOW_rename_level_in_rename_description_entry251, FOLLOW_rename_subject_literal_in_rename_description_entry256, FOLLOW_rename_subject_range_in_rename_description_entry260, FOLLOW_RENAMES_LEVEL_in_rename_level289, FOLLOW_separate_clause_in_sign_leading_clause960, FOLLOW_separate_clause_in_sign_trailing_clause998, FOLLOW_SEPARATE_in_separate_clause1033, FOLLOW_set_in_synchronized_clause1065, FOLLOW_sign_clause_in_clauses616, FOLLOW_SIGN_in_sign_clause917, FOLLOW_sign_leading_clause_in_sign_clause919, FOLLOW_sign_trailing_clause_in_sign_clause922, FOLLOW_SIGNED_INT_in_literal1523, FOLLOW_SINGLEFLOAT_in_usage_clause1129, FOLLOW_SPACE_CONSTANT_in_literal1683, FOLLOW_SPACE_CONSTANT_in_literal1780, FOLLOW_synchronized_clause_in_clauses626, FOLLOW_SYNCHRONIZED_in_synchronized_clause1063, FOLLOW_TRAILING_in_sign_trailing_clause996, FOLLOW_usage_clause_in_clauses636, FOLLOW_USAGE_in_usage_clause1103, FOLLOW_USAGE_in_usage_clause1127, FOLLOW_USAGE_in_usage_clause1151, FOLLOW_USAGE_in_usage_clause1175, FOLLOW_USAGE_in_usage_clause1199, FOLLOW_USAGE_in_usage_clause1223, FOLLOW_USAGE_in_usage_clause1247, FOLLOW_USAGE_in_usage_clause1271, FOLLOW_USAGE_in_usage_clause1295, FOLLOW_USAGE_in_usage_clause1319, FOLLOW_USAGE_in_usage_clause1343, FOLLOW_USAGE_in_usage_clause1367, FOLLOW_value_clause_in_clauses646, FOLLOW_value_clause_literal_in_value_clause1402, FOLLOW_VALUE_in_value_clause1400, FOLLOW_VARARRAY_in_variable_length_table1936, FOLLOW_variable_length_table_in_occurs_clause864, FOLLOW_ZERO_CONSTANT_in_literal1663, FOLLOW_ZERO_CONSTANT_in_literal1774, FOLLOW_ZERO_LITERAL_STRING_in_literal1583, 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.tree.TreeParser
DOWN, input, UP
 
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
CobolStructureEmitterImpl(org.antlr.runtime.tree.TreeNodeStream input, RecognizerErrorHandler errorHandler)
          Construct from a tree nodes stream.
CobolStructureEmitterImpl(org.antlr.runtime.tree.TreeNodeStream input, org.antlr.runtime.RecognizerSharedState state, RecognizerErrorHandler errorHandler)
          Construct from a tree nodes 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.CobolStructureEmitter
blank_when_zero_clause, clauses, cobdata, condition_description_entry, condition_level, condition_subject_literal, condition_subject_range, data_description_entry, data_entry, data_item_level, data_item_name, date_format_clause, depending_on, external_clause, fixed_length_table, getGrammarFileName, getTokenNames, global_clause, group_usage_clause, high_bound, index_clause, justified_clause, key_clause, literal, low_bound, occurs_clause, picture_clause, redefines_clause, rename_description_entry, rename_level, rename_subject_literal, rename_subject_range, separate_clause, sign_clause, sign_leading_clause, sign_trailing_clause, synchronized_clause, usage_clause, value_clause_literal, value_clause, variable_length_table
 
Methods inherited from class org.antlr.runtime.tree.TreeParser
getCurrentInputSymbol, getErrorHeader, getMissingSymbol, getSourceName, getTreeNodeStream, matchAny, recoverFromMismatchedToken, reset, setTreeNodeStream, traceIn, traceOut
 
Methods inherited from class org.antlr.runtime.BaseRecognizer
alreadyParsedRule, beginResync, combineFollows, computeContextSensitiveRuleFOLLOW, computeErrorRecoverySet, consumeUntil, consumeUntil, displayRecognitionError, endResync, failed, getBacktrackingLevel, getNumberOfSyntaxErrors, getRuleInvocationStack, getRuleInvocationStack, getRuleMemoization, getRuleMemoizationCacheSize, getTokenErrorDisplay, match, memoize, mismatchIsMissingToken, mismatchIsUnwantedToken, pushFollow, recover, recoverFromMismatchedSet, 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

CobolStructureEmitterImpl

public CobolStructureEmitterImpl(org.antlr.runtime.tree.TreeNodeStream input,
                                 RecognizerErrorHandler errorHandler)
Construct from a tree nodes stream.

Parameters:
input - the tree nodes stream
errorHandler - handles error messages

CobolStructureEmitterImpl

public CobolStructureEmitterImpl(org.antlr.runtime.tree.TreeNodeStream input,
                                 org.antlr.runtime.RecognizerSharedState state,
                                 RecognizerErrorHandler errorHandler)
Construct from a tree nodes stream and a shared state.

Parameters:
input - the tree nodes 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.tree.TreeParser

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.