Built-in BNF items for pgen

The built-in BNF items for ''pgen'' are:

  • INT: integers
  • REAL: real numbers
  • ID: C-style identifiers
  • STRING: strings
  • expr: C-style expressions of any type
  • int_expr: integer expressions
  • bool_expr: Boolean expressions

If any of the expression constructs are used, then the user must also define the BNF item expr_id, which is used to parse the identifiers that can be part of an expression.

Type Value
INT int
REAL double
ID char *
STRING char *
expr Expr *
int_expr Expr *
bool_expr Expr *

The char * returned for a STRING includes the two double-quotes that delimit the string.