Constants

 

The constants listed below have the same values that are used in the Compiled Grammar Table file. Naturally, you can make the values anything you want, but it is easier to have them match.

constants Symbol-Kind-Constant

Nonterminal   = 0
Terminal     
= 1
Whitespace
    = 2
End-Of-File  
= 3
Comment-Start
= 4
Comment-End
   = 5
Comment-Line
  = 6
Error
         = 7

end constants

 

The constants listed below have the same values that are used in the Compiled Grammar Table file. Naturally, you can make the values anything you want, but it is easier to have them match.

constants Action-Type-Constant

Shift   = 1
Reduce  = 2
Goto    = 3
Accept  = 4

end constants

 

The ParseToken ( ) function returns one of the following constants to the Parse() function. The value is used to detemine how the Parse ( ) function will behave and which Message-Constant, if any, is ultimately returned to the developer.

constants Parse-Result-Constant

Shift
Reduce
Reduce-Trimmed

Accept
Syntax-Error
Internal-Error

end constants

 

The Parse ( ) function returns one of the following constants which specifies the action that was performed. This is the approach that is used by a number of different Engines. Although this approach works, you can design the system however you think is best.

constants Message-Constant

Token-Read
Reduction
Accept
Not-Loaded-Error
Lexical-Error
Syntax-Error


Runaway-Comment-Error
Unmatched-Comment-Error

Internal-Error

end constants