
The rules for LCM squashing allow a preliminary design to be generated:

	LCMSQUASH input-LCM-file output-LCM-file /[NO]LIST=list_file 

this design does not have the ability to chain through @ references in files.


	Open the specified input-LCM-file
	set line_count for current file to 0
	Open the specified output LCM file
	Open a listing file
	while we were able to read a line from current input file
	    increment line count for current file
	    output line count and input line to listing file
	    process line
	endwhile
	close current input file
	close listing file
	close output file



which becomes
	
	open_files()
	   open specified file for input
	   create specified file for output
	   if /LIST spacified create specified file for listing
	   set line_count to 0


	close_files()
	   close input file
	   close (or delete if something went wrong) output file
	   if /list close (or delete if something went wrong) listing file


	lcmsquash()
	   open_files
	   process_input
	   close_files
	

	process_input
	   while ( read_line(input_file,buffer) != EOF)
	     process_buffer (buffer)
	   endwhile
	     

	process_buffer
	   get ascii string out of byte bufffer 
	   if we have a listing file output this line to it
	   this line could contain multiple commands so
	   while not at the end of this line
	     extract next command
	     process command
	   end while
	   
	extract command
	   strip leading spaces from input string
	   copy characters from current position to the next # or <CR>
	   strip trailing spaces
	   we now have a single command
	   update current position to be the end of current command

	process()
	    action to take depending on first character
	      %: process lites2 command
	      !: process comment
	      @: process LCM reference
	      ': process command substitution
	      .: process label
	      anything else is assumed to be a macro call

	process_comment
	   do nothing

	process_LCM_reference
	   as chaining through LCMs isnt designed for, output it faithfully

	process_command_substitution
	   not supported, output line faithfully

	process_label
	   read to end of word
	   strip of trailing ":"
	   add to list of labels
	   if allready defined output a warning

	process_lites2_call
	   read a word
	   truncate it to a maximum of 4 characters
	   generate output
	   scan rest of string for variables, macro,labels

	process_macro_call
	   backspace and read the macro name
	   if macro wasn't defined
	     output a warning to the list file
	   endif
	   generate output
	   scan rest of string for variables,macro,labels
