home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / educaton / inf_src.arc / RULECOMP.STR < prev    next >
Text File  |  1986-03-14  |  1KB  |  48 lines

  1.  
  2. /*
  3. Pseudo code for the rule compiler :
  4.  
  5. compile_rules(rule_file,output_compile_file)
  6. {
  7. OPEN rule_file ;
  8. WHILE ( EOF in rule_file NOT reached )
  9.     {
  10.     locate keyword
  11.     IF ( keyword not located on line and line not blank )
  12.         {
  13.         OUTPUT error message to user telling of problem
  14.         }
  15.     place flag associated with keyword into rule section
  16.     IF (following string is in string section)
  17.         {
  18.         place the address of the string into the rule section
  19.         }
  20.     ELSE
  21.         {
  22.         place the string into the string section (0 delimit)
  23.         place the address of the string into the rule section
  24.         }
  25.     IF ( the keyword is a THEN or THENHYP )
  26.         {
  27.         place and additional IF flag and a zeroed 
  28.             pointer in the rule section 
  29.         place address of hypothesis or then clause into
  30.             hypstack section
  31.         }
  32.     }
  33. IF (last keyword not of a "HYP" type )
  34.     {
  35.     OUTPUT warning to user about this being a problem
  36.     }
  37. place  two successive IF flags - zeroed pointer into the rule section
  38.     to mark the end of the rules section.
  39. CLOSE rule_file 
  40. OPEN compile_output_file 
  41. OUTPUT number of bytes in rule section to compile_output_file
  42. COPY rule section to compile_output_file
  43. OUTPUT number of bytes in string section to compile_output_file
  44. COPY string section to compile_output_file
  45. CLOSE compile_output_file
  46. }
  47. */
  48.