Software Secret Weapons™


 
Borland Delphi Language Grammar
by Pavel Simakov on 2006-04-22 10:40:35 under Code Linguine, view comments
Bookmark and Share
 


About  •  Contact  •  Articles  •  Projects  •  My Links  •  My Bookshelf  •  Past And Present

This grammar is a part of our LEX & YACC experience.


Product Id {032DE83F-D365-493B-89E6-CD0CB6C22111} 
Package Id {BC62B507-6CB1-4E96-90D3-2FEAE2EAA253} 
Base language Borland Delphi 5 Object Pascal 
Base language description "Borland Delphi 5 Object Pascal" is a general
purpose programming language implemented in Borland Delphi and Kylix. 
Schema timestamp 11/16/2001 9:39:45 PM 

Lexical analyzer tokens

tkAsciiChar  
tkAsmBody  
tkCompiler  
tkCRLF  
tkFloat  
tkIdentifier  
tkInline  
tkInteger  
tkJunk  
tkHex  
tkNumber  
tkSpace  
tkStringLiteral  
tkIgnore  
tkUnknown  
tkAnsiComment  
tkBorComment  
tkSlashesComment  
tkAddressOf  
tkAssign  
tkComma  
tkColon  
tkDeref  
tkDotDot  
tkPoint  
tkRoundOpen  
tkRoundClose  
tkSemiColon  
tkSlashes  
tkSquareOpen  
tkSquareClose  
tkSymbol  
tkAt  
tkOn  
tkArray  
tkBegin  
tkCase  
tkClass  
tkConst  
tkConstructor  
tkContains  
tkDestructor  
tkDispinterface  
tkDo  
tkDownto  
tkElse  
tkEnd  
tkExcept  
tkExports  
tkFile  
tkFinalization  
tkFinally  
tkFor  
tkFunction  
tkGoto  
tkIf  
tkImplementation  
tkInherited  
tkInitialization  
tkInterface  
tkLabel  
tkLibrary  
tkNil  
tkNot  
tkObject  
tkOf  
tkOut  
tkPackage  
tkPacked  
tkProcedure  
tkProgram  
tkProperty  
tkRaise  
tkRecord  
tkRepeat  
tkRequires  
tkResourcestring  
tkSet  
tkString  
tkStringResource  
tkThen  
tkThreadvar  
tkTo  
tkTry  
tkType  
tkUnit  
tkUntil  
tkUses  
tkVar  
tkWhile  
tkWith  
tkMinus  
tkPlus  
tkOr  
tkXor  
tkAnd  
tkDiv  
tkMod  
tkShl  
tkShr  
tkSlash  
tkStar  
tkAs  
tkEqual  
tkGreater  
tkGreaterEqual  
tkIn  
tkIs  
tkLower  
tkLowerEqual  
tkNotEqual  
tkShortInt  
tkSmallInt  
tkOrdInteger  
tkByte  
tkLongInt  
tkInt64  
tkWord  
tkBoolean  
tkChar  
tkWideChar  
tkLongWord  
tkPChar  
tkCardinal  
tkReal48  
tkReal  
tkSingle  
tkDouble  
tkExtended  
tkCurrency  
tkComp  
tkAnsiString  
tkWideString  
tkVariant  
tkOleVariant  
tkRegister  
tkPascal  
tkNear  
tkFar  
tkCdecl  
tkSafecall  
tkStdcall  
tkAbsolute  
tkAbstract  
tkAssembler  
tkAutomated  
tkDefault  
tkDispid  
tkDynamic  
tkExport  
tkExternal  
tkForward  
tkImplements  
tkIndex  
tkMessage  
tkName  
tkNodefault  
tkOverload  
tkOverride  
tkPrivate  
tkProtected  
tkPublic  
tkPublished  
tkRead  
tkReadOnly  
tkReintroduce  
tkResident  
tkStored  
tkVirtual  
tkWrite  
tkWriteOnly  

Grammatical analyzer rules

parse_goal : program_file 
  | unit_file 
  | library_file 
  | package_file 
  ; 
  
error_recovery : tkInterface 
  | tkimplementation 
  | tkVar 
  | tkConst 
  | tkType 
  | tkResourceString 
  | tkObject 
  | tkFunction 
  | tkProcedure 
  | tkBegin 
  | tkEnd 
  | tkSemiColon 
  ; 
  
program_file : program_heading main_uses_clause program_block tkPoint 
  ; 
  
program_heading :  
  | tkProgram program_name program_heading_2 
  ; 
  
program_heading_2 : tkSemiColon 
  | tkRoundOpen program_param_list tkRoundClose tkSemiColon 
  ; 
  
program_name : tkIdentifier 
  ; 
  
program_param_list : program_param 
  | program_param_list tkComma program_param 
  ; 
  
program_param : tkIdentifier 
  ; 
  
program_block : program_decl_sect_list compound_stmt 
  ; 
  
program_decl_sect_list : impl_decl_sect_list 
  ; 
  
uses_clause :  
  | tkUses used_units_list tkSemiColon 
  ; 
  
used_units_list : used_units_list tkComma used_unit_name 
  | used_unit_name 
  ; 
  
used_unit_name : tkIdentifier 
  ; 
  
main_uses_clause :  
  | tkUses main_used_units_list tkSemiColon 
  ; 
  
main_used_units_list : main_used_units_list tkComma main_used_unit_name 
  | main_used_unit_name 
  ; 
  
main_used_unit_name : tkIdentifier 
  | tkIdentifier tkIn tkStringLiteral 
  ; 
  
library_file : library_heading main_uses_clause library_block tkPoint 
  ; 
  
library_heading : tkLibrary tkIdentifier tkSemiColon 
  ; 
  
library_block : library_impl_decl_sect_list compound_stmt 
  ; 
  
library_impl_decl_sect_list :  
  | library_impl_decl_sect_list library_impl_decl_sect 
  ; 
  
library_impl_decl_sect : label_decl_sect 
  | const_decl_sect 
  | res_str_decl_sect 
  | type_decl_sect 
  | var_decl_sect 
  | proc_decl 
  | func_decl 
  | constructor_decl 
  | destructor_decl 
  | export_clause 
  ; 
  
export_clause : tkExports exports_list tkSemiColon 
  ; 
  
exports_list : exports_entry 
  | exports_list tkComma exports_entry 
  ; 
  
exports_entry : identifier exports_index exports_name exports_resident 
  ; 
  
exports_index :  
  | tkIndex integer_const 
  ; 
  
exports_name :  
  | tkName identifier 
  | tkName literal 
  ; 
  
exports_resident :  
  | tkResident 
  ; 
  
unit_file 
  : unit_heading interface_part implementation_part initialization_part tkPoint 
  ; 
  
unit_heading : tkUnit unit_name tkSemiColon 
  ; 
  
unit_name : tkIdentifier 
  ; 
  
interface_part : tkInterface uses_clause int_decl_sect_list 
  ; 
  
implementation_part : tkImplementation uses_clause impl_decl_sect_list 
  ; 
  
initialization_part : tkEnd 
  | tkInitialization stmt_list tkEnd 
  | tkInitialization stmt_list tkFinalization stmt_list tkEnd 
  | tkBegin stmt_list tkEnd 
  ; 
  
package_file : tkPackage package_name tkSemiColon requires_clause 
  contains_clause tkEnd tkPoint 
  ; 
  
package_name : identifier 
  ; 
  
requires_clause :  
  | tkRequires 
  | tkRequires main_used_units_list tkSemiColon 
  ; 
  
contains_clause :  
  | tkContains 
  | tkContains main_used_units_list tkSemiColon 
  ; 
  
int_decl_sect_list :  
  | int_decl_sect_list int_decl_sect 
  ; 
  
impl_decl_sect_list :  
  | impl_decl_sect_list impl_decl_sect 
  ; 
  
int_decl_sect : const_decl_sect 
  | res_str_decl_sect 
  | type_decl_sect 
  | var_decl_sect 
  | int_proc_heading 
  | int_func_heading 
  ; 
  
impl_decl_sect : label_decl_sect 
  | const_decl_sect 
  | res_str_decl_sect 
  | type_decl_sect 
  | var_decl_sect 
  | proc_decl 
  | func_decl 
  | constructor_decl 
  | destructor_decl 
  ; 
  
int_proc_heading : proc_heading 
  | proc_heading inline_directr tkSemiColon 
  | proc_heading tkForward tkSemiColon 
  | proc_heading fp_directives 
  ; 
  
int_func_heading : func_heading 
  | func_heading inline_directr tkSemiColon 
  | func_heading tkForward tkSemiColon 
  | func_heading fp_directives 
  ; 
  
label_decl_sect : tkLabel label_list tkSemiColon 
  ; 
  
label_list : label_name 
  | label_list tkComma label_name 
  ; 
  
label_name : tkInteger 
  | identifier 
  ; 
  
const_decl_sect : tkConst const_decl 
  | const_decl_sect const_decl 
  ; 
  
res_str_decl_sect : tkResourcestring const_decl 
  | res_str_decl_sect const_decl 
  ; 
  
type_decl_sect : tkType type_decl 
  | type_decl_sect type_decl 
  ; 
  
var_decl_sect : tkVar var_decl 
  | tkThreadvar var_decl 
  | var_decl_sect var_decl 
  ; 
  
const_decl : const_name tkEqual const_expr tkSemiColon 
  | const_name tkColon type_ref tkEqual typed_const tkSemiColon 
  ; 
  
const_name : identifier 
  ; 
  
const_expr : const_simple_expr 
  | const_simple_expr const_relop const_simple_expr 
  ; 
  
const_relop : tkEqual 
  | tkNotEqual 
  | tkLower 
  | tkGreater 
  | tkLowerEqual 
  | tkGreaterEqual 
  | tkIn 
  ; 
  
const_simple_expr : const_term 
  | const_simple_expr const_addop const_term 
  ; 
  
const_addop : tkPlus 
  | tkMinus 
  | tkOr 
  | tkXor 
  ; 
  
const_term : const_factor 
  | const_term const_mulop const_factor 
  ; 
  
const_mulop : tkStar 
  | tkSlash 
  | tkDiv 
  | tkMod 
  | tkShl 
  | tkShr 
  | tkAnd 
  ; 
  
const_factor : const_variable 
  | const_set 
  | unsigned_number 
  | literal 
  | tkNil 
  | tkAddressOf const_factor 
  | tkRoundOpen const_expr tkRoundClose 
  | tkNot const_factor 
  | sign const_factor 
  | tkDeref const_factor 
  ; 
  
const_set : tkSquareOpen const_elem_list tkSquareClose 
  ; 
  
sign : tkPlus 
  | tkMinus 
  ; 
  
const_variable : identifier 
  | const_variable const_variable_2 
  ; 
  
const_variable_2 : tkPoint identifier 
  | tkDeref 
  | tkRoundOpen const_func_expr_list tkRoundClose 
  ; 
  
const_func_expr_list : const_expr 
  | const_expr tkComma const_expr 
  ; 
  
const_elem_list :  
  | const_elem_list1 
  ; 
  
const_elem_list1 : const_elem 
  | const_elem_list1 tkComma const_elem 
  ; 
  
const_elem : const_expr 
  | const_expr tkDotDot const_expr 
  ; 
  
unsigned_number : tkInteger 
  | tkHex 
  | tkFloat 
  ; 
  
typed_const : const_expr 
  | array_const 
  | record_const 
  ; 
  
array_const : tkRoundOpen typed_const_list tkRoundClose 
  | tkRoundOpen record_const tkRoundClose 
  | tkRoundOpen array_const tkRoundClose 
  ; 
  
typed_const_list :  
  | typed_const tkComma typed_const 
  | typed_const_list tkComma typed_const 
  ; 
  
record_const : tkRoundOpen const_field_list tkRoundClose 
  ; 
  
const_field_list : const_field tkSemiColon const_field_list 
  | const_field tkSemiColon 
  | const_field 
  ; 
  
const_field : const_field_name tkColon typed_const 
  ; 
  
const_field_name : identifier 
  ; 
  
type_decl : identifier tkEqual type_decl_type tkSemiColon 
  | error error_recovery 
  ; 
  
type_decl_type : type_ref 
  | tkType type_ref 
  | object_type 
  ; 
  
type_ref : simple_type 
  | string_type 
  | pointer_type 
  | structured_type 
  | procedural_type 
  ; 
  
simple_type : ord_type_name 
  | real_type_name 
  | variant_type_name 
  | simple_type_identifier 
  | range_expr tkDotDot range_expr 
  | tkRoundOpen enumeration_id_list tkRoundClose 
  ; 
  
range_expr : range_term 
  | range_expr const_addop range_term 
  ; 
  
range_term : range_factor 
  | range_term const_mulop range_factor 
  ; 
  
range_factor : identifier 
  | unsigned_number 
  | sign range_factor 
  | literal 
  | identifier tkRoundOpen const_expr tkRoundClose 
  | tkRoundOpen const_expr tkRoundClose 
  ; 
  
simple_type_identifier : tkIdentifier 
  | unit_name tkPoint identifier 
  ; 
  
enumeration_id_list : enumeration_id tkComma enumeration_id 
  | enumeration_id_list tkComma enumeration_id 
  ; 
  
enumeration_id : identifier 
  ; 
  
pointer_type : tkDeref identifier 
  ; 
  
structured_type : unpacked_structured_type 
  | tkPacked unpacked_structured_type 
  ; 
  
unpacked_structured_type : array_type 
  | record_type 
  | set_type 
  | file_type 
  ; 
  
array_type 
  : tkArray tkSquareOpen simple_type_list tkSquareClose tkOf type_ref 
  | tkArray tkOf type_ref 
  ; 
  
simple_type_list : simple_type 
  | simple_type_list tkComma simple_type 
  ; 
  
record_type : tkRecord field_list tkEnd 
  | tkRecord tkEnd 
  ; 
  
field_list : fixed_part 
  | variant_part 
  | fixed_part_2 tkSemiColon variant_part 
  ; 
  
fixed_part : fixed_part_2 
  | fixed_part_2 tkSemiColon 
  ; 
  
fixed_part_2 : record_section 
  | fixed_part_2 tkSemiColon record_section 
  ; 
  
record_section : record_section_id_list tkColon type_ref 
  ; 
  
record_section_id_list : record_section_id 
  | record_section_id_list tkComma record_section_id 
  ; 
  
record_section_id : identifier 
  ; 
  
variant_part : tkCase tag_field tkOf variant_list 
  ; 
  
tag_field : tag_field_name 
  | tag_field_name tkColon tag_field_typename 
  ; 
  
tag_field_name : identifier 
  ; 
  
tag_field_typename : identifier 
  ; 
  
variant_list : variant_list_2 
  | variant_list_2 tkSemiColon 
  ; 
  
variant_list_2 : variant 
  | variant_list_2 tkSemiColon variant 
  ; 
  
variant : case_tag_list tkColon tkRoundOpen variant_field_list tkRoundClose 
  ; 
  
variant_field_list :  
  | field_list 
  ; 
  
case_tag_list : const_expr 
  | case_tag_list tkComma const_expr 
  ; 
  
set_type : tkSet tkOf simple_type 
  ; 
  
file_type : tkFile tkOf type_ref 
  | tkFile 
  ; 
  
string_type : string_type_name 
  | tkString tkSquareOpen const_expr tkSquareClose 
  ; 
  
procedural_type : procedural_type_kind 
  | procedural_type_kind calling_conventions 
  ; 
  
procedural_type_kind : procedural_type_decl 
  | procedural_type_decl tkOf tkObject 
  ; 
  
procedural_type_decl : tkProcedure fp_list 
  | tkFunction fp_list tkColon fptype 
  ; 
  
object_type : new_object_type 
  | old_object_type 
  ; 
  
old_object_type : tkObject oot_successor oot_component_list oot_privat_list tkEnd 
  ; 
  
oot_privat_list :  
  | tkPrivate oot_component_list 
  ; 
  
oot_component_list :  
  | oot_field_list 
  | oot_field_list oot_method_list 
  | oot_method_list 
  ; 
  
oot_successor : tkRoundOpen oot_typeidentifier tkRoundClose 
  ; 
  
oot_typeidentifier : identifier 
  ; 
  
oot_field_list : oot_field 
  | oot_field_list oot_field 
  ; 
  
oot_field : oot_id_list tkColon type_ref tkSemiColon 
  ; 
  
oot_id_list : oot_field_identifier 
  | oot_id_list tkComma oot_field_identifier 
  ; 
  
oot_field_identifier : identifier 
  ; 
  
oot_method_list : oot_method 
  | oot_method_list oot_method 
  ; 
  
oot_method : oot_method_head 
  ; 
  
oot_method_head : proc_heading 
  | func_heading 
  | oot_constructor_head 
  | oot_destructor_head 
  ; 
  
oot_constructor_head : tkConstructor proc_name fp_list fp_directives 
  ; 
  
oot_destructor_head : tkDestructor proc_name fp_list fp_directives 
  ; 
  
new_object_type : not_class_reference_type 
  | not_object_type 
  | not_interface_type 
  ; 
  
not_class_reference_type : tkClass tkOf not_object_type_identifier 
  ; 
  
not_object_type_identifier : identifier 
  ; 
  
not_object_type : tkClass 
  | tkClass not_heritage 
  | tkClass not_component_list_seq tkEnd 
  | tkClass not_heritage not_component_list_seq tkEnd 
  ; 
  
not_interface_type : tkInterface 
  | tkInterface not_heritage 
  | tkInterface not_component_list_seq tkEnd 
  | tkInterface not_heritage not_component_list_seq tkEnd 
  | tkDispinterface 
  | tkDispinterface not_heritage 
  | tkDispinterface not_component_list_seq tkEnd 
  | tkDispinterface not_heritage not_component_list_seq tkEnd 
  ; 
  
not_component_list_seq : not_component_list 
  | not_component_list_seq visibility_specifier not_component_list 
  ; 
  
not_heritage : tkRoundOpen not_object_type_identifier_list tkRoundClose 
  ; 
  
not_object_type_identifier_list : identifier 
  | not_object_type_identifier_list tkComma identifier 
  ; 
  
not_component_list : not_guid 
  | not_guid not_component_list_1 
  | not_guid not_component_list_2 
  | not_guid not_component_list_1 not_component_list_2 
  ; 
  
not_guid :  
  | tkSquareOpen const_expr tkSquareClose 
  ; 
  
not_component_list_1 : not_field_definition 
  | not_component_list_1 not_field_definition 
  ; 
  
not_component_list_2 : not_method_definition 
  | not_property_definition 
  | not_component_list_2 not_method_definition 
  | not_component_list_2 not_property_definition 
  ; 
  
not_field_definition 
  : not_field_identifier_list tkColon type_ref tkSemiColon 
  ; 
  
not_field_identifier_list : not_field_identifier 
  | not_field_identifier_list tkComma not_field_identifier 
  ; 
  
not_field_identifier : identifier 
  ; 
  
not_method_definition : not_method_heading 
  ; 
  
not_method_heading : tkClass proc_heading 
  | tkClass func_heading 
  | func_heading 
  | proc_heading 
  | not_constructor_heading 
  | not_destructor_heading 
  ; 
  
not_constructor_heading 
  : tkConstructor qualified_identifier fp_list fp_directives 
  ; 
  
not_destructor_heading : tkDestructor qualified_identifier fp_list fp_directives 
  ; 
  
qualified_identifier : identifier 
  | visibility_specifier 
  | qualified_identifier tkPoint identifier 
  | qualified_identifier tkPoint visibility_specifier 
  ; 
  
not_property_definition : 
    tkProperty qualified_identifier 
    not_property_interface not_property_specifiers tkSemiColon 
    not_array_defaultproperty 
  ; 
  
not_array_defaultproperty :  
  | tkDefault tkSemiColon 
  ; 
  
not_property_interface :  
  | not_property_parameter_list tkColon qualified_identifier 
  not_property_interface_index 
  ; 
  
not_property_interface_index :  
  | tkIndex expr 
  ; 
  
not_property_parameter_list :  
  | tkSquareOpen not_parameter_decl_list tkSquareClose 
  ; 
  
not_parameter_decl_list : not_parameter_decl 
  | not_parameter_decl_list tkSemiColon not_parameter_decl 
  ; 
  
not_parameter_decl : not_parameter_name_list tkColon fptype 
  | tkConst not_parameter_name_list tkColon fptype 
  | tkVar not_parameter_name_list tkColon fptype 
  | tkOut not_parameter_name_list tkColon fptype 
  ; 
  
not_parameter_name_list : not_parameter_name 
  | not_parameter_name_list tkComma not_parameter_name 
  ; 
  
not_parameter_name : identifier 
  ; 
  
not_property_specifiers :  
  | tkReadOnly not_property_specifiers 
  | tkWriteOnly not_property_specifiers 
  | tkDispid const_expr not_property_specifiers 
  | tkDefault const_expr not_property_specifiers 
  | tkNodefault not_property_specifiers 
  | tkStored const_expr not_property_specifiers 
  | tkRead expr not_property_specifiers 
  | tkImplements not_object_type_identifier_list not_property_specifiers 
  | tkWrite expr not_property_specifiers 
  ; 
  
var_decl : var_name_list tkColon type_ref absolute_clause tkSemiColon 
  | var_name_list tkColon type_ref absolute_clause tkEqual 
    var_init_value tkSemiColon 
  | var_name_list error error_recovery 
  ; 
  
var_init_value : typed_const 
  ; 
  
var_name_list : var_name 
  | var_name_list tkComma var_name 
  ; 
  
var_name : identifier 
  ; 
  
absolute_clause :  
  | tkAbsolute tkInteger tkColon tkInteger 
  | tkAbsolute tkHex tkColon tkHex 
  | tkAbsolute declared_var_name 
  ; 
  
declared_var_name : identifier 
  ; 
  
constructor_decl : not_constructor_heading not_constructor_block_decl 
  ; 
  
destructor_decl : not_destructor_heading not_constructor_block_decl 
  ; 
  
not_constructor_block_decl : block 
  | external_directr 
  | asm_block 
  ; 
  
proc_decl : proc_heading proc_block 
  | tkClass proc_heading proc_block 
  ; 
  
func_decl : func_heading func_block 
  | tkClass func_heading func_block 
  ; 
  
proc_heading : tkProcedure proc_name fp_list fp_directives 
  | tkProcedure proc_name tkEqual qualified_identifier tkSemiColon 
  | tkProcedure proc_name error error_recovery 
  ; 
  
proc_name : identifier 
  | visibility_specifier 
  | proc_name tkPoint identifier 
  | proc_name tkPoint visibility_specifier 
  ; 
  
func_heading : tkFunction func_name fp_list tkColon fptype fp_directives 
  | tkFunction func_name fp_directives 
  | tkFunction func_name tkEqual qualified_identifier tkSemiColon 
  | tkFunction func_name error error_recovery 
  ; 
  
fp_directives : tkSemiColon 
  | tkSemiColon method_access_directive fp_directives 
  | tkSemiColon calling_conventions fp_directives 
  | tkSemiColon tkDispid const_expr fp_directives 
  | tkSemiColon tkMessage integer_const fp_directives 
  ; 
  
func_name : identifier 
  | visibility_specifier 
  | func_name tkPoint identifier 
  | func_name tkPoint visibility_specifier 
  ; 
  
proc_block : proc_block_decl 
  | inline_directr tkSemiColon 
  ; 
  
func_block : proc_block_decl 
  | inline_directr tkSemiColon 
  ; 
  
proc_block_decl : block 
  | external_directr 
  | asm_block 
  | tkForward tkSemiColon 
  ; 
  
external_directr : tkExternal tkSemiColon 
  | tkExternal identifier external_directr_2 
  | tkExternal literal external_directr_2 
  | tkExternal literal external_directr_2 tkSemiColon 
  | tkExternal identifier external_directr_2 tkSemiColon 
  ; 
  
external_directr_2 :  
  | tkName identifier 
  | tkName literal 
  | tkIndex external_directr_3 
  ; 
  
external_directr_3 : tkInteger 
  | tkMinus tkInteger 
  ; 
  
asm_block : impl_decl_sect_list tkAsmBody tkSemiColon 
  ; 
  
block : impl_decl_sect_list compound_stmt tkSemiColon 
  ; 
  
fp_list :  
  | tkRoundOpen fp_sect_list tkRoundClose 
  ; 
  
fp_sect_list :  
  | fp_sect 
  | fp_sect_list tkSemiColon fp_sect 
  ; 
  
fp_sect : param_name_list tkColon fptype_new 
  | param_name_list 
  | tkVar param_name_list tkColon fptype_new 
  | tkVar param_name_list 
  | tkOut param_name_list tkColon fptype_new 
  | tkOut param_name_list 
  | tkConst param_name_list tkColon fptype_new 
  | tkConst param_name_list 
  ; 
  
param_name_list : param_name 
  | param_name_list tkComma param_name 
  ; 
  
param_name : identifier 
  ; 
  
fptype : identifier 
  | unit_name tkPoint identifier 
  ; 
  
fptype_new : fptype 
  | fptype tkEqual const_expr 
  | tkArray tkOf fptype 
  | tkArray tkOf tkConst 
  ; 
  
stmt : unlabelled_stmt 
  | label_name tkColon unlabelled_stmt 
  ; 
  
unlabelled_stmt :  
  | assignment 
  | proc_call 
  | goto_stmt 
  | compound_stmt 
  | if_stmt 
  | case_stmt 
  | repeat_stmt 
  | while_stmt 
  | for_stmt 
  | with_stmt 
  | asm_stmt 
  | inline_directr 
  | inherited_message 
  | try_stmt 
  | raise_stmt 
  ; 
  
assignment : var_reference tkAssign expr 
  ; 
  
proc_call : var_reference 
  ; 
  
goto_stmt : tkGoto label_name 
  ; 
  
compound_stmt : tkBegin stmt_list tkEnd 
  ; 
  
stmt_list : stmt 
  | stmt_list tkSemiColon stmt 
  ; 
  
if_stmt : tkIf expr if_then_else_branch 
  ; 
  
if_then_else_branch : tkThen then_branch 
  | tkThen then_branch tkElse else_branch 
  ; 
  
then_branch : stmt 
  ; 
  
else_branch : stmt 
  ; 
  
case_stmt : tkCase expr tkOf case_list else_case tkEnd 
  ; 
  
case_list : case_item 
  | case_list tkSemiColon case_item 
  ; 
  
case_item :  
  | case_label_list tkColon stmt 
  ; 
  
case_label_list : case_label 
  | case_label_list tkComma case_label 
  ; 
  
case_label : const_expr 
  | const_expr tkDotDot const_expr 
  ; 
  
else_case :  
  | tkElse stmt_list 
  ; 
  
repeat_stmt : tkRepeat stmt_list tkUntil expr 
  ; 
  
while_stmt : tkWhile expr tkDo stmt 
  ; 
  
for_stmt : tkFor identifier tkAssign expr for_to 
  ; 
  
for_to : tkTo expr tkDo stmt 
  | tkDownto expr tkDo stmt 
  ; 
  
with_stmt : tkWith expr_list tkDo stmt 
  ; 
  
inherited_message : tkInherited 
  ; 
  
try_stmt : tkTry stmt_list try_handler 
  ; 
  
try_handler : tkFinally stmt_list tkEnd 
  | tkExcept exception_block tkEnd 
  ; 
  
exception_block : exception_handler_list exception_block_else_branch 
  | exception_handler_list tkSemiColon exception_block_else_branch 
  | stmt_list 
  ; 
  
exception_handler_list : exception_handler 
  | exception_handler_list tkSemiColon exception_handler 
  ; 
  
exception_block_else_branch :  
  | tkElse stmt_list 
  ; 
  
exception_handler : tkOn exception_identifier tkDo stmt 
  ; 
  
exception_identifier : exception_class_type_identifier 
  | exception_variable tkColon exception_class_type_identifier 
  ; 
  
exception_class_type_identifier : identifier 
  ; 
  
exception_variable : identifier 
  ; 
  
raise_stmt : tkRaise 
  | tkRaise expr 
  | tkRaise expr tkAt expr 
  ; 
  
asm_stmt : tkAsmBody 
  ; 
  
expr_list : expr 
  | expr_list tkComma expr 
  ; 
  
expr : simple_expr 
  | simple_expr relop expr 
  | simple_expr tkColon simple_expr 
  | simple_expr tkColon simple_expr tkColon simple_expr 
  ; 
  
relop : tkEqual 
  | tkNotEqual 
  | tkLower 
  | tkGreater 
  | tkLowerEqual 
  | tkGreaterEqual 
  | tkIn 
  | tkIs 
  ; 
  
simple_expr : term 
  | simple_expr addop term 
  ; 
  
addop : tkPlus 
  | tkMinus 
  | tkOr 
  | tkXor 
  ; 
  
term : factor 
  | term mulop factor 
  ; 
  
mulop : tkStar 
  | tkSlash 
  | tkDiv 
  | tkMod 
  | tkShl 
  | tkShr 
  | tkAnd 
  | tkAs 
  ; 
  
factor : unsigned_number 
  | literal 
  | tkNil 
  | tkSquareOpen elem_list tkSquareClose 
  | tkNot factor 
  | sign factor 
  | tkDeref factor 
  | var_reference 
  ; 
  
var_reference : var_address variable 
  | variable 
  ; 
  
var_address : tkAddressOf 
  | var_address tkAddressOf 
  ; 
  
variable : identifier 
  | tkInherited identifier 
  | tkRoundOpen expr tkRoundClose 
  | tkRoundOpen tkRoundClose 
  | variable var_specifiers 
  ; 
  
var_specifiers : tkSquareOpen expr_list tkSquareClose 
  | tkSquareOpen tkSquareClose 
  | tkRoundOpen expr_list tkRoundClose 
  | tkRoundOpen tkRoundClose 
  | tkPoint identifier 
  | tkDeref 
  ; 
  
elem_list :  
  | elem_list1 
  ; 
  
elem_list1 : elem 
  | elem_list1 tkComma elem 
  ; 
  
elem : expr 
  | expr tkDotDot expr 
  ; 
  
inline_directr : tkInline tkRoundOpen inline_element tkRoundClose 
  ; 
  
inline_element : inline_param 
  | inline_element tkSlash inline_param 
  ; 
  
inline_param : tkLower inline_const 
  | tkGreater inline_const 
  | inline_param_variable 
  ; 
  
inline_param_variable : var_reference 
  | inline_param_variable sign inline_const 
  | tkHex 
  ; 
  
inline_const : const_factor 
  ; 
  
literal : tkStringLiteral 
  | tkAsciiChar 
  | tkStringLiteral literal 
  | tkAsciiChar literal 
  ; 
  
integer_const : sign tkInteger 
  | tkInteger 
  | sign tkHex 
  | tkHex 
  | identifier 
  | sign identifier 
  ; 
  
real_type_name : tkReal48 
  | tkReal 
  | tkSingle 
  | tkDouble 
  | tkExtended 
  | tkCurrency 
  | tkComp 
  ; 
  
ord_type_name : tkShortInt 
  | tkSmallInt 
  | tkOrdInteger 
  | tkByte 
  | tkLongInt 
  | tkInt64 
  | tkWord 
  | tkBoolean 
  | tkChar 
  | tkWideChar 
  | tkLongWord 
  | tkPChar 
  | tkCardinal 
  ; 
  
variant_type_name : tkVariant 
  | tkOleVariant 
  ; 
  
string_type_name : tkString 
  | tkAnsiString 
  | tkWideString 
  ; 
  
calling_conventions : tkRegister 
  | tkPascal 
  | tkCdecl 
  | tkSafecall 
  | tkNear 
  | tkFar 
  | tkStdcall 
  | tkResident 
  | tkExport 
  | tkAssembler 
  ; 
  
property_specifier_directives : tkDefault 
  | tkRead 
  | tkWrite 
  | tkStored 
  | tkNodefault 
  | tkImplements 
  | tkWriteOnly 
  | tkReadOnly 
  | tkDispid 
  ; 
  
method_access_directive : tkAbstract 
  | tkAutomated 
  | tkDynamic 
  | tkOverload 
  | tkOverride 
  | tkReintroduce 
  | tkVirtual 
  ; 
  
non_reserved : tkAt 
  | tkAbsolute 
  | tkOn 
  | tkName 
  | tkIndex 
  | tkMessage 
  | tkContains 
  | tkRequires 
  | tkForward 
  | tkOut 
  ; 
  
visibility_specifier : tkPublished 
  | tkPublic 
  | tkProtected 
  | tkPrivate 
  ; 
  
other : tkPackage 
  | tkUnit 
  | tkLibrary 
  | tkProgram 
  | tkExternal 
  ; 
  
identifier : tkIdentifier 
  | real_type_name 
  | ord_type_name 
  | variant_type_name 
  | string_type_name 
  | method_access_directive 
  | calling_conventions 
  | property_specifier_directives 
  | non_reserved 
  | other 
  ; 

No comments yet


Leave a comment


 
Dog Emotional 2010 Calendar Dog Emotional Mousepad Dog Fashionable 2010 Calendar Dog Fashionable Mousepad

Copyright © 2004-2010 by Pavel Simakov
any conclusions, recommendations, ideas, thoughts or the source code presented on this site are my own and do not reflect a official opinion of my current or past employers, partners or clients
SourceForge.net Logo