SYNOPSIS

This example illustrates a way to set a naming scheme for the grammar productions using give_token_name.

give_token_name: The name of the production is the Left Hand Side of the Production Rule followed by the word _is_ followed by the concatenation of the names of the tokens in the right hand side (separated by underscores).

Compile it with:

$ eyapp -C give_token_names.eyp 

and run it: $ ./give_token_names.pm -t -i -m 1 -c '*a = b'

It will produce an output like:

s_is_ASSIGN(
  l_is_POINTER(
    TERMINAL,
    r_is_l(
      l_is_VAR(
        TERMINAL[a]
      )
    )
  ),
  TERMINAL,
  r_is_l(
    l_is_VAR(
      TERMINAL[b]
    )
  )
)

The main difference between this file and give_names_to_tokens.eyp is that the tokens in the right hand sides are already identifiers: ASSIGN and POINTER.