Skip to content
Roopesh Chander edited this page Nov 21, 2017 · 1 revision

This document is a work in progress

The Citron Grammar File

The Citron Grammar File contains:

  • The rules of the input grammar in a BNF-like format
  • The code blocks associated with each rule of the grammar
  • Citron directives, including type declarations

Rules

Code blocks

Directives

Specifying types

  • token_type
  • default_nonterminal_type
  • nonterminal_type

Naming

  • class_name
  • token_prefix

Code insertion

  • preface
  • epilogue
  • extra_class_members

Precedence and associativity

  • left_associative
  • right_associative
  • non_associative

Grammar controls

  • start_symbol
  • token
  • fallback
  • wildcard
  • token_set