parser_state_model.hlp in $CASE/gen/ver_10log/ (was std/aareadme - 96/7/30 - RJL) This new directory was created to hold bde versions of state models for chgen source code. The first example I expect to complete is the behavior of parse_schema.c's lexical analyzer parse_schema_chgen(), which has a 3-state model. States are: NULL, STARTED and WITHIN. Also of interest are the alternate error exits and what they signify. These occur as the result of computable guard conditions, not because of an input event. They might be considered substates of WITHIN and STARTED. The only event in this state model is the return from hcg_parse(buffer,temp_buffer,&idx). This puts a new token into .... The states in each form of the parser are found this way: (grep on 'void' identifies most if not all function boundaries.) --------------------------------------- remus(147)> grep 'state_(NULL|STARTED|WITHIN)|void' parse_schema.c 12:/* returns : void, exits on fatal schema errors. */ 117:void parse_schema() 125:void parse_schema_chgen() 136: parse_state = state_NULL; 165: case state_NULL : /* expecting start of a new table */ 242: parse_state = state_STARTED; 246: case state_STARTED : /* expecting '{' symbol */ 254: parse_state = state_WITHIN; 260: case state_WITHIN : /* expecting data-field line */ 265: parse_state = state_NULL; 457: parse_state = state_WITHIN; 468:void create_primary_key() 551:void parse_schema_gendb() 565: parse_state = state_NULL; 595: case state_NULL : /* expecting start of a new table */ 697: parse_state = state_STARTED; 701: case state_STARTED : /* expecting '{' symbol */ 709: parse_state = state_WITHIN; 715: case state_WITHIN : /* expecting data-field line */ 720: parse_state = state_NULL; 945: parse_state = state_WITHIN; 955:void find_parent (char* tbuffer) 1016:void Output_MetaSchema () ----------------------------------------- FOcus on parse_schema_chgen() in lines 125:468: The state model is trivial: NULL------tblabbr------->STARTED-------'{'------>WITHIN _ / |\ / \_____________________'}'____________________/ Of greater interest are the alternate error exits and what they signify. These occur as the result of computable guard conditions, not because of an input event. They might be considered substates of WITHIN and STARTED.