Description
This page lists all the productions in the Ivory language grammar, separated by basic function. The grammar is completely context-free, given certain precedence rules and associativity. Note: this particular grammar is designed more for reading, and may not be 100% usable with yacc. The parser description in the bootstrap compiler, is slightly terser, but is 100% acceptable to yacc.
Associativity
The following terminals are right-associative:
- if
- else
- (
- )
- +=
- -=
- *=
- /=
- %=
- >>=
- <<
- |=
- &=
- ^=
The following terminals are left-associative, and in order of precedence:
- --, ++, [, ]
- ?, :
- ||
- &&
- |
- ^
- &
- !=
- ==
- <=
- >=
- <
- >
- <<
- >>
- -
- +
- /
- %
- *
Productions
The program production acts as the starting symbol for an ivory program.
Productions are divided as follows:
Program Structure
Declarations
- decl
- def
- inner_decl
- control_stm
- function_def
- collect_def
- enum_def
- module_def
- signature_def
- template_def
- variable_decl
- module_decl
- signature_decl
- collect_decl
- enum_decl
- type_decl
- include_stm
- import_stm
- export_stm
- sig_list
- temp_param_list
- ref
Types
- typename
- declspec_list
- declspec
- typespec
- typequal_list
- typequal
- collect_spec
- typemod_list
- typemod
- array
- pointer
- function
- params
- paramdecl_list
Statements
- stm_list
- stm
- outer_stm
- catch_stm
- catch_list
- inner_stm
- inner_stm
- if_stm
- do_stm
- while_stm
- for_stm
- exp_stm
- empty_stm
- compound_stm
- switch_stm
- return_stm
- throw_stm
- break_stm
- continue_stm