BNF Documentation of ADL language
Appendix: META SYMBOLS
ADL
=
{ADL_component}
ADL_component =
<global_command>
| <axis>
| <comment>
global_command
=
( "filetype delimited " "/t" | <string>
)<-- character used can not appear in data.
if special characters used,must escape using "/"
|( "include " <file_name>
)
|( "maxlen " <const> )
|( "maxrec " <const> )
|( "mincell " <const> )
|( "mintable " <const> )
|( "maxaxislabel " <const> )
|( "maxcases " <const> )
|( "maxelemlabel " <const> )
|( "other " "off"|<const> )
|( "suppress " "off"|<const> )
|( "SpecialCharacters " "on"|"off" )
|( "debug " "off" | "0" | "1" | "2" )
|( "ifo" {character} "endifo"
)
|( "filter " <expression>
)
|( "lnk" <string> "endlnk"
)
| <variable_declaration>
axis
=
"["
<axis_type>
"]"
axis_type =
<standard_axis>
| <average>
| <single_defined_percentage>
| <changing_percentage_bases>
| <heading>
| <measure>
| <weight>
| <value_axis>
| <YNGrid_preset_table>
| <matrix_preset_table>
standard_axis =
<title>
( <where_statement> "auto")
| ( ["col"] [where_statement]
<element> {element} [macro])
| <macro>
average =
<title>
<element>["value=" <const>]
{ <element>["value=" <const>]
}
<element_name> " =M" |
" =m" <-- to activate average calculation,"Suppress"
must be "off"
single_defined_percentage
=
<title>
"<quote>Total<quote>"
<expression>
<element>
{<element>}
changing_percentage_bases
=
<title>
{
<predefined_base_element_declaration>
<element>
{<element>}
}
heading =
<title>
<expression>
measure =
<title>
<where_statement>
["add"]
weight =
<measure>
<where_statement>
"weight"
value_axis =
( <title>
<where_statement>
"vax="<title>
<string>
{<string>}
)
|( <title>
<where_statement>
"link="<title> <-- title of
any existing standard axis
)
YNGrid_preset_table
=
<title>
"yngrid="<col_num>
<element_name>
{<element_name>}
<element>
{<element>}
matrix_preset_table
=
<title>
"matrix="<col_num>
<element_name>
{<element_name>}
<element>
{<element>}
*****to test include file in macro******
***Back to top***
comment
=
<single_line_comment>
[multi_line_comment]
single_line_comment = ";" {character}
multi_line_comment = "(*" {character} "*)"
variable_declaration
=
<variable_name>
!<quote>
!"\"
"="
<const> | "&"<location> | <string>
!<key_words>
variable_name
=
( <character> !<digit> )
{<character>}
!<key_words>
if_statement
=
"if"
["("]
<expression>
{expression}
[")"]
<expression>
{expression}
{else_statement}
else_statement
=
{else_if}
<else>
else_if
=
"else if"
["("]
<expression>
{expression}
[")"]
<expression>
{expression}
else
=
"else"
["("]
<expression>
{expression}
[")"]
<expression>
{expression}
where_statement
=
"where="
<location> | <expression>
element
=
<element_name>
[expression]
element_name
=
<string>
expression
=
<location>"="
["("]<const>("+" | "-" | "*" | "/")<const>[")"]
macro
=
"define"
<axis_type> | <global_command>
"enddef"
quote
=
" '' " <--double quotation mark, ASCII code 0x22.Must be used in pairs
|" ' " <--single quotation mark, ASCII code 0x27.Must be used in pairs
key_words
=
"add"
|"base"
|"blank"
|"debug"
|"define"
|"enddef"
|"if"
|"else"
|"to"
|"for"
|"by"
|"where"
|"col"
|"link"
|"float"
|"byte"
|"word"
|"filter"
|"vax"
|"maxcases"
|"maxrec"
symbol
=
"\" <-- Will disappear after beeing processed if followed by <character>
And makes special symbols available in titles
|";"
|"/"
location
=
[card_ref]
<col_num>["_"<const>]
[" to "<col_num>]
|[" for "<const>]
|[" by "<const>]
|<variable>
{","<location>}
null
=
<quote><quote> <-- empty between
quotation marks
file_name
=
<string> <-- limited to valid windows file names
string
=
<quote> {character} <quote>
character
=
( "a..z,A..Z,`,~,!,@,#,$,%,^,&,*,(,),_,+,|,-,=,{,},[,],:,",;,',<,>,?,,,.,
<space><const>"
!<key_words> )
{character}
space
=
" " <-- ASCII code 0x20
const
=
<digit>{digit}
digit
=
"0..9"
1. "=" --> "is defined as"
2. " | " --> "or"
3. "< >" --> surround category names, distinguish syntax rules ( non-terminal )
names from terminal symbols
4. "[ ]" --> optional items
5. "{ }" --> repetitive items ( zero or more )
6. "( )" --> grouping items
7. "''" --> used to distinguish terminal symbols from meta-symbols
8. "<--" --> BNF comments
9. "!" --> NOT