cobol: Resume source format after copybook ends.

The ISO CDF SOURCE FORMAT directive controls interpretation of the ensuing
source code, including copybook files until EOF.  At the end of a
copybook, any changes it made to the SOURCE FORMAT status is
discarded.

The scanner determines whether or not Debugging Mode ('D' in column 7)
lines are included.  Because it does not know the source format, for
Reference Format files the lexio module replaces the 'D' with 0x8D,
which to the scanner signifies a Debug line.

gcc/cobol/ChangeLog:

	* cbldiag.h (cdf_push_source_format): Remove declaration.
	(cdf_pop_source_format): Same.
	* cdf-copy.cc (is_fixed_format): Same.
	(is_reference_format): Same.
	(esc): Pass new format parameter and use new 0x8D Debug indicator.
	* cdf.y: Ignore SOURCE FORMAT directive (handled in lexio.cc).
	* lexio.cc (cdf_source_format): Delete function definition.
	(source_format_t::infer): Same.
	(is_fixed_format): Same.
	(is_reference_format): Same.
	(left_margin): Same.
	(right_margin): Same.
	(include_debug): Assume fixed format.
	(set_debug): Same.
	(continues_at): Remove unused function.
	(indicated): Move function to source_format_t class.
	(source_format_t::indicated): Replace ::indicated().
	(filespan_t::tab_check): Delete function.
	(check_push_pop_directive): Add format stack parameter.
	(check_source_format_directive): Same.
	(esc): Add format parameter and use 0x8D indicator.
	(parse_replace_pairs): Add format parameter.
	(parse_copy_directive): Same.
	(parse_replace_text): Same.
	(parse_replace_directive): Same.
	(cdftext::lex_open): Instantiate and pass format stack.
	(cdftext::free_form_reference_format): Add format stack parameter and 0x8D indicator.
	(cobol_set_indicator_column): Stash command-line option.
	(cdftext::process_file): Add format stack parameter.
	* lexio.h (struct filespan_t): Remove tab_check() function.
	(class source_format_t): Lift into header file to share with cdf-copy.cc.
	(class cdftext): Add several functions, formerly file-scope.
	(free_form_reference_format): Move to source_format_t.
	* parse.y: Slightly simplify parse of WITH DEBUGGING MODE.
	* scan.l: Recognize new 0x8D indicator.
	* scan_ante.h (cobol_set_indicator_column): Remove declaration.
	* util.cc (class cdf_directives_t): Remove source format support.
	(cobol_set_indicator_column): Move function to lexio.cc.
	(cdf_source_format): Delete function.
	(cdf_push_source_format): Same.
	(cdf_pop_source_format): Same.
	* util.h (class source_format_t): Move to lexio.h.
10 files changed