CVersionInfo Dr. Detlef Meyer-EltzPParsergenerator and Interpreter1.7.3.0 Tetra.exe+Copyright 2002 - 09 Dr. Detlef Meyer-Eltz Tetra.exeTextTransformernormal BIN_NUMBERCToken=J BIN_NUMBER%[01]+COMMENT_DELPHICToken>JCOMMENT_DELPHI//[^\r\n]*\r?\n CTRL_CHARCTokentJ CTRL_CHARtb0187.pp: c:=^.; { this compile in tp7, c should contain 'n'/#110 } The care (^) character toggles the sixth bit ($40) of the character's value, which changes an upper case letter to its control character equivalent. If the character is lowercase, the caret clears the fifth and sixth bits ($60). This means you can apply the caret to nonalphabetic characters. For example ^2 is the same as 'r' because '2' has the ordinal value $32, and toggling the $40 bit makes it $72, which is the ordinal value for 'r'. (From Delphi in a nutshell). CTRL_CHAR1CTokenJ CTRL_CHAR1*"|" was missing before the single quote ""P#(\d+|{HEX_NUMBER}) \ |\^[@a-zA-Z] \ "" \ single quote CTRL_CHAR2CTokenlJ CTRL_CHAR2tb0187.pp: c:=^.; { this compile in tp7, c should contain 'n'/#110 } The care (^) character toggles the sixth bit ($40) of the character's value, which changes an upper case letter to its control character equivalent. If the character is lowercase, the caret clears the fifth and sixth bits ($60). This means you can apply the caret to nonalphabetic characters. For example ^2 is the same as 'r' because '2' has the ordinal value $32, and toggling the $40 bit makes it $72, which is the ordinal value for 'r'. (From Delphi in a nutshell)\^.DIGITSCTokenhJDIGITS\d+ HEX_NUMBERCTokenD J HEX_NUMBER~Eine Pascal Hexadezimal-Zahl als ein Dollarzeichen gefolgt von bis zu acht Ziffern oder Buchstaben aus dem Bereich 'A' bis 'F'\$[[:xdigit:]]+IDCToken !JID[a-zA-Z_][\da-zA-Z_]* IGNORABLECToken!J IGNORABLE( \ \s \// spaces |//[^\n]*\n \// Zeilenkommentare |\{[^}]*\} \// {...}-comment |\(\*[^*]*\*+([^)*][^*]*\*+)*\) \// (*...*)-comment )+NUMBERCToken`"(" parameter_declaration ( ";" parameter_declaration )* ")" % IGNORABLE pointer_typeCProduction_LINKK pointer_type "^" type_id | "pointer" primitive_typeCProduction_LINKKprimitive_type "boolean" | "bytebool" | "wordbool" | "longbool" | "integer" | "cardinal" | "shortint" | "smallint" | "longint" | "int64" | "byte" | "word" | "longword" | "char" | "widechar" | "ansichar" | "pchar" procedural_typeCProduction_LINKKprocedural_type( "procedure" parameter_declaration_list? | "function" parameter_declaration_list? ":" result_type ) ( "of" "object" )? ( ";" | call_modifier )* procedure_declarationCProduction_LINKKprocedure_declarationAprocedure_header code_procedure_directives subroutine_block % IGNORABLEprocedure_headerCProduction_LINKKprocedure_header3"procedure" qual_id parameter_declaration_list? procedure_headers_partCProduction_LINKKprocedure_headers_part( procedure_header | function_header_with_result ) method_suffixes* ( external_directive ";"? //( code_procedure_directives ";")* )? program_fileCProduction_LINK\K program_fileCprogram_heading? uses_clause? declaration_part* init_section program_headingCProduction_LINKKprogram_heading0"program" ID ( "(" qual_id_list ")" )? ";" property_definitionCProduction_LINKKproperty_definitionN"property" ID property_interface property_specifiers hintdirective? property_interfaceCProduction_LINK`Kproperty_interfacex( "[" parameter_declaration ( ";" parameter_declaration )* "]" )? ( ":" type_id )? ( "index" integer_expression )? property_specifiersCProduction_LINK Kproperty_specifiers( "read" field_or_method )? ( "write" field_or_method | "implements" qual_id_list )? ( "stored" const_expr )? ( "default" const_expr | "nodefault" )? "readonly"? "writeonly"? ( "dispid" integer_expression )? ( ";" ( "default" ";")? )? qual_idCProduction_LINKKqual_idID ("." ID)* qual_id_listCProduction_LINKdK qual_id_listqual_id ("," qual_id)* raise_stmtCProduction_LINKK raise_stmt:"raise" ( expr ( "at" address_expression )? )? rangeCProduction_LINKLrange"." "." ( "." EXIT )? real_typeCProduction_LINKL real_typeL "real" | "real48" | "single" | "double" | "extended" | "comp" record_constCProduction_LINKL record_const0//"(" const_field (";" const_field? )* //")" record_field_listCProduction_LINK Lrecord_field_list+( record_section ";"? )* record_variant? record_sectionCProduction_LINKLrecord_section_D4 system.pas contains C type relicts! See c_or_pas_type for a possible (formal only) solutionqual_id_list ":" type record_typeCProduction_LINK L record_type""record" record_field_list "end" record_variantCProduction_LINK Lrecord_variant"case" ID (":" ordinal_type )? "of" ( //const_expr ( "," const_expr )* ordinal_list ":" "(" record_field_list ")" ";"? )+ register_listCProduction_LINK<L register_list>"[" string_constant ( "," string_constant )* "]" rel_opCProduction_LINK@Lrel_opG "=" | ">" | ">=" | "<" | "<=" | "in" | "is" | "<>" repeat_stmtCProduction_LINKDL repeat_stmt$"repeat" stmt_list? "until" expr requires_clauseCProduction_LINKHLrequires_clause"requires" qual_id_list ";" resource_definitionCProduction_LINK-Lresource_definition:ID "=" string_constant_ex_declaration hintdirective? ";" % IGNORABLEresourcestring_declaration_partCProduction_LINK/Lresourcestring_declaration_part*"resourcestring" resource_definition* % IGNORABLE result_typeCProduction_LINKp1L result_type type_id selectorsCProduction_LINK3L selectorsEstart and succ warning disabled, which would be raised from case_stmt( "." ID //member selector | "^" //dereference | "(" writearg_list? ")" //call or typecast | "[" expr_list? "]" //array or property selector )* ( "as" factor )? ` IGNORABLE selectors_cCProduction_LINK4L selectors_cEstart and succ warning disabled, which would be raised from case_stmt( "." ID //member selector | "^" //dereference | "(" expr_list_c? ")" //call or typecast | "[" expr_list_c? "]" //array or property selector )* ` IGNORABLEset_typeCProduction_LINKt6Lset_type"set" "of" simple_type simple_exprCProduction_LINK 8L simple_exprterm (add_op term)* simple_expr_cCProduction_LINK9L simple_expr_cterm_c ( add_op term_c )* IGNORABLE simple_expr_iCProduction_LINKx;L simple_expr_iterm_i (add_op term_i)* \t\n\r simple_expr_tCProduction_LINK$=L simple_expr_tterm_t (add_op term_t)* \t\n\r simple_typeCProduction_LINKM simple_typeenum or array constructors0 ordinal_type | real_type | pointer_type simple_type_cCProduction_LINKM simple_type_cenum or array constructors2 ordinal_type_c | real_type //| pointer_type IGNORABLE source_moduleCProduction_LINKM source_modulez""? // not opened as UTF8 ( library_file | package_file | unit_file | program_file ) "." SKIP? specialized_typeCProduction_LINK Mspecialized_type["specialize" {{ AddWarning("Free Pascal spezialization is not supported"); }} EXIT OK stmtCProduction_LINKMstmtD WHILE(is_stmt_label()) label END stmt_notLabel? stmt_listCProduction_LINKM stmt_list: ";" stmt_list_not_empty? | stmt_list_not_empty stmt_list_not_emptyCProduction_LINKMstmt_list_not_emptyb stmt ( IF(!is_end_of_stmt_list()) ";"+ stmt ELSE ";" END )* \t\n\r stmt_list0CProduction_LINKM stmt_list0Jless complicated than the actual "stmt_list", but causes a lot of warnings( stmt | ";" )+ \t\n\r stmt_notLabelCProduction_LINK M stmt_notLabel assignment_stmt | asm_statement | compound_stmt | case_stmt | for_stmt | goto_stmt | if_stmt | inline_block | raise_stmt | repeat_stmt | try_stmt | while_stmt | with_stmt IGNORABLEstr_typeCProduction_LINKMstr_type,string_type is typedef in the generated codeY "string" ( "[" const_expr "]" )? | "shortstring" | "ansistring" | "widestring" string_constantCProduction_LINKMstring_constante( NUMBER | STRING | "'" {{ throw CTT_Error("String constant exceeds line"); }} )+ \t\n\r string_constant_exCProduction_LINKMstring_constant_ex3( string_constant | "^" CTRL_CHAR )+ string_constant_ex_declarationCProduction_LINKMstring_constant_ex_declarationD ( ID | string_constant_ex ) ( "+" ( ID | string_constant_ex ) )* IGNORABLEstring_expressionCProduction_LINKMstring_expressionexpr structured_constCProduction_LINKMstructured_const["(" ( IF(is_id_colon()) record_const ELSE array_const END )? ")" structured_typeCProduction_LINK Mstructured_type( "packed" | "bitpacked" // free pascal )? ( array_type | record_type | object_type | class_type //| class_reference_type | interface_type | set_type | file_type ) subrange_typeCProduction_LINKȣM subrange_type'simple_expr_t ( ".." simple_expr_t )? subrange_type_cCProduction_LINK̥Msubrange_type_c'simple_expr_c ( ".." simple_expr_c )? \t\n\r subroutine_blockCProduction_LINKЧMsubroutine_block ( "forward" ( ";" ( "overload" ";"? )? )? | external_directive code_procedure_directives // e.g. procedure Sleep; external kernel32 name 'Sleep'; stdcall; | ( block | asm_block ) ";"? ) termCProduction_LINKīMtermfactor (mul_op factor)* term_cCProduction_LINKȭMterm_c!factor_c ( mul_op factor_c )* IGNORABLEterm_iCProduction_LINK̯Mterm_ifactor_i (mul_op factor_i)* \t\n\r term_tCProduction_LINKxMterm_tfactor_t (mul_op factor_t)* \t\n\r threadvariable_declaration_partCProduction_LINK$Mthreadvariable_declaration_part$"threadvar" variable_declaration+ IGNORABLEtry_stmtCProduction_LINKдMtry_stmt]"try" stmt_list? ( "finally" stmt_list? | "except" exception_block? ) "end" typeCProduction_LINK|Mtype simple_type hintdirective? //simple_type | structured_type | procedural_type | str_type // free pascal | generic_type // free pascal | specialized_type type_declarationCProduction_LINK(Mtype_declaration ID "=" "type"? type hintdirective? // free pascal | generic_type // free pascal // free pascal | operator_declaration | D2009_type type_declaration_partCProduction_LINKWtype_declaration_part%"type" ( type_declaration ";"? )+ type_idCProduction_LINKYtype_idH qual_id | primitive_type | real_type | str_type | "OleVariant" typed_constantCProduction_LINK[typed_constant9 IF(expr()) expr ELSE structured_const END typed_constant_declarationCProduction_LINK]typed_constant_declaration0":" type "=" typed_constant hintdirective? ";" unit_fileCProduction_LINK_ unit_fileS"unit" ID hintdirective? ";" interface_part implementation_part init_section unit_nameCProduction_LINKa unit_name)e.g. tw1279 : testunit in 'webtbs/uw1279'"ID ( "in" string_expression )? unsigned_integerCProduction_LINKcunsigned_integer8 DIGITS | HEX_NUMBER | OCT_NUMBER | BIN_NUMBER \t\n\r uses_clauseCProduction_LINKe uses_clause*"uses" unit_name ("," unit_name)* ";" value_parameterCProduction_LINKgvalue_parameterqual_id ( ("," qual_id)+ ":" array_of? type_id | ":" ( array_of type_id | type_id ( "=" const_expr )? ) ) % IGNORABLEvalue_parameter_optionsCProduction_LINKkvalue_parameter_options ( ("," qual_id)+ ":" array_of? type_id | ":" ( array_of type_id | type_id ( "=" const_expr )? ) ) \t\n\r variable_declarationCProduction_LINKmvariable_declarationv ident_list ":" type ( "=" typed_constant )? variable_modifier* // free pascal | operator_declaration variable_declaration_partCProduction_LINKovariable_declaration_part"var" variable_declaration+ variable_modifierCProduction_LINKqvariable_modifier "absolute" expr_i | ";" ( "export" | "cvar" | external_directive )? | hintdirective variable_parameterCProduction_LINKtvariable_parameter0"var" qual_id_list ( ":" array_of? type_id )? % IGNORABLEvcl_compiletime_functionsCProduction_LINKvvcl_compiletime_functions ( ( "ord" | "chr" // | "Trunc" ceil // | "Round" floor // | "High" // | "Low" // | "Abs" // | "Pred" // | "Succ" //// | "Length" // | "Odd" | "SizeOf" ) "(" expr? ")" ) \t\n\r vcl_functionCProduction_LINK{ vcl_function( "Assigned" "(" expr? ")" | "dec" "(" expr? ( "," expr | {{ /* empty */ }} ) ")" | "FillChar" "(" expr? "," expr "," expr ")" | "inc" "(" expr? ( "," expr | {{ /* empty */ }} ) ")" | "Length" "(" expr? ")" | "New" "(" expr ")" // 2 params in free pascal | "PAnsiChar" "(" expr ")" | "SetLength" "(" expr "," expr ")" // 3 params in free pascal | vcl_compiletime_functions ) \t\n\r vcl_function_nameCProduction_LINK }vcl_function_namek( "Assigned" | "Dec" | "FillChar" | "Inc" | "Length" | "New" | "PAnsiChar" | "SetLength" // vcl compile time | "ord" | "chr" // | "Trunc" ceil // | "Round" floor // | "High" // | "Low" // | "Abs" // | "Pred" // | "Succ" //// | "Length" // | "Odd" | "SizeOf" ) \t\n\r visibilityCProduction_LINKM visibilityy "strict"? // Delphi 8 ( "private" | "protected" ) | "public" | "published" | "automated" while_stmtCProduction_LINKh while_stmt"while" expr "do" stmt? with_stmtCProduction_LINKl with_stmt"with" expr_list "do" stmt? writeargCProduction_LINKpwritearg expr (":" expr (":" expr)? )? writearg_listCProduction_LINKt writearg_list<copes with special argument construct for Write(), WriteLn()writearg ( "," "&"? /* vcl 2009 HTMLHelpViewer.pas HtmlHelp(0, nil, HH_INITIALIZE, &FInitializedCookie); */ writearg )* case1 CTestScript case1 case_stmt &case x of 1: if y then a else b endcasetestcase2 CTestScriptЈcase2 case_stmt Lcase x of 1: if y then a; //semicolon separates from case-else else b end casetestsComments CTestScriptCommentssource_module { Comment 1 (* comment 2 *) } (* Comment 1 { comment 2 } *) { comment 1 // Comment 2 } (* comment 1 // Comment 2 *) // comment 1 (* comment 2 *) // comment 1 { comment 2 } unit test ; interface implementation end.MethRes CTestScriptMethResQIF (method_resolution()) method_resolution ";" ELSE {{ out << "mist"; }} END $function Itest.GetProp = GetProp2; prop1 CTestScriptprop1property_definition .property arr[index: string]: string; default; COptionsProjectfProjectOptionsProjectOptionsCOptionSectionHProjectOptions5 CaseSensitiveCScript CaseSensitive0CharTypeTemplateCScriptCharTypeTemplate1 CommentToCodeCScriptd CommentToCode0 ConfigParamCScriptȏ ConfigParam""CopyCodeCScript,CopyCode0Cpp_PrjParserHeaderCScriptCpp_PrjParserHeaderCpp_PrjParserSourceCScriptCpp_PrjParserSourceCreateConstProductionsCScriptXCreateConstProductions0CreateInterfaceCScriptCreateInterface0CreateWideCharRegexCScript CreateWideCharRegex0DOMDefaultLabelCScriptDOMDefaultLabel default_labelDOMDocTypeNameCScriptDOMDocTypeName DOMPublicIDCScriptL DOMPublicID DOMRootLabelCScript DOMRootLabelroot DOMSystemIDCScript DOMSystemID ExportableCScriptx Exportable1 ExtraParamCScriptܔ ExtraParam""GlobalLiteralScannerCScript@GlobalLiteralScanner1GlobalRegexScannerCScriptGlobalRegexScanner0 IgnoreCharsCScript IgnoreChars\t\n\rIgnoreWhiteSpaceCScriptlIgnoreWhiteSpace1 InclusionProdCScriptЖ InclusionProdCOMMENT IndentCharCScript4 IndentCharws IndentDeltaCScript IndentDelta2 InterpretableCScript Interpretable1IsNullableWarningCScript`IsNullableWarning0 LATokenBufferCScriptV LATokenBuffer0LookAheadOverlapWarningCScriptsLookAheadOverlapWarning0 MaxStackSizeCScripti MaxStackSize300NeatlessCScriptNeatless1 NoAnyFailAltCScriptT NoAnyFailAlt1 NoSkipFailAltCScriptԩM NoSkipFailAlt0OpSystemCScript(MOpSystem0 PluginTypeCScriptx PluginTypeCTT_ParseStatePlugin PreprocessorCScript