Grammars

Software Product Line

  • HIS

The Home Integration System (HIS) is a feature model representing integrated systems of a house [Kang et al. 2002].

G.startSymbol = "his"

G.LHS_communication = seq(V.communication,V.message)
G.his = alt(seq(V.services,seq(V.administration,seq(V.detection_devices,seq(V.action_devices,seq(V.monitor_control,V.quality_attributes))))),seq(V.services,seq(V.administration,seq(V.detection_devices,seq(V.action_devices,seq(V.monitor_control,seq(V.quality_attributes,V.LHS_communication)))))))
G.LHS_flood = seq(V.flood,terminal('t_moisture_sensor'))
G.services = alt(seq(terminal('t_security'),seq(V.intrusion,V.fire)),seq(terminal('t_security'),seq(V.intrusion,seq(V.fire,V.LHS_flood))))
G.intrusion = seq(V.detection_intrusion,V.action_intrusion)
G.detection_intrusion = V.motion
G.motion = V.monitoring_detecting_motion
G.monitoring_detecting_motion = V.id_0
G.id_0 = alt(terminal('t_discrete_value'),terminal('t_continuous_value'))
G.LHS_message = seq(V.message,V.communication)
G.action_intrusion = alt(seq(terminal('t_door_operation'),terminal('t_alarm')),seq(terminal('t_door_operation'),seq(terminal('t_alarm'),V.LHS_message)))
G.message = alt(terminal('t_voice'),seq(terminal('t_voice'),terminal('t_data')))
G.fire = seq(V.detection_fire,V.action_fire)
G.detection_fire = V.smoke
G.smoke = V.monitoring_detecting_smoke
G.monitoring_detecting_smoke = V.id_1
G.id_1 = alt(terminal('t_discrete_value'),terminal('t_continuous_value'))
G.LHS_water = seq(terminal('t_water'),terminal('t_sprinkler'))
G.action_fire = alt(V.LHS_water,seq(V.LHS_water,terminal('t_gas')))
G.flood = seq(V.detection_flood,V.action_flood)
G.detection_flood = V.moisture
G.moisture = V.monitoring_detecting_moisture
G.monitoring_detecting_moisture = V.id_2
G.id_2 = alt(terminal('t_discrete_value'),terminal('t_continuous_value'))
G.LHS_pumping = seq(terminal('t_pumping'),terminal('t_sump_pump'))
G.action_flood = alt(terminal('t_water_main'),seq(terminal('t_water_main'),V.LHS_pumping))
G.administration = V.hmi
G.hmi = V.id_3
G.id_3 = alt(terminal('t_standard'),terminal('t_advanced'))
G.communication = alt(terminal('t_telephone'),seq(terminal('t_telephone'),V.internet))
G.internet = V.connection
G.connection = V.id_4
G.id_4 = alt(terminal('t_tcp'),terminal('t_udp'))
G.LHS_moisture_sensor = seq(terminal('t_moisture_sensor'),terminal('t_flood'))
G.detection_devices = alt(seq(terminal('t_motion_sensor'),terminal('t_skoke_sensor')),seq(terminal('t_motion_sensor'),seq(terminal('t_skoke_sensor'),V.LHS_moisture_sensor)))
G.LHS_sprinkler = seq(terminal('t_sprinkler'),terminal('t_water'))
G.LHS_sump_pump = seq(terminal('t_sump_pump'),terminal('t_pumping'))
G.action_devices = alt(V.LHS_sprinkler,seq(V.LHS_sprinkler,V.LHS_sump_pump))
G.monitor_control = seq(terminal('t_direct'),seq(V.scheduled,seq(V.responding_strategy,terminal('t_event_based'))))
G.scheduled = seq(terminal('t_periodic'),terminal('t_one_time'))
G.responding_strategy = alt(terminal('t_priority'),seq(terminal('t_priority'),terminal('t_sequential')))
G.quality_attributes = seq(terminal('t_usability'),seq(terminal('t_scalability'),seq(V.reliability,terminal('t_safety'))))
G.reliability = V.redundancy_control
G.redundancy_control = V.id_5
G.id_5 = alt(terminal('t_active'),terminal('t_standby'))
  • Model Transformation

Model transformation represents a feature model of transformations for taxonomy [Czarnecki and Helsen 2003].

G.startSymbol = "Model_Transformation"

G.Model_Transformation = alt(seq(V.Transformation_rules,seq(V.Source_Target_relationship,seq(V.Rule_application_strategy,seq(V.Rule_scheduling,seq(V.Rule_organization,seq(V.Tracing,V.Directionality)))))),seq(V.Transformation_rules,seq(V.Source_Target_relationship,seq(V.Rule_application_strategy,seq(V.Rule_scheduling,seq(V.Rule_organization,seq(V.Tracing,seq(V.Directionality,V.Rule_application_scoping))))))))
G.Transformation_rules = alt(V.LHS_RHS,seq(V.LHS_RHS,terminal('t_LHS_RHS_Syntactic_Separation')),terminal('t_Bidirectionality'),terminal('t_Parameterization'),terminal('t_Intermediate_structures'))
G.LHS_RHS = alt(V.Variables,V.id_1)
G.Variables = V.id_0
G.id_0 = alt(terminal('t_Untyped'),terminal('t_Syntactically_typed'),terminal('t_Semantically_typed'))
G.id_1_sec = alt(empty(),V.id_1)
G.id_1 = alt(seq(V.Patterns,V.id_1_sec),seq(V.Logic,V.id_1_sec))
G.Patterns = seq(V.Form_Patt,seq(V.Syntax,V.Typing))
G.Form_Patt = V.id_2
G.id_2 = alt(terminal('t_Strings'),terminal('t_Terms'),terminal('t_Graphs'))
G.Syntax = V.id_3
G.id_3_sec = alt(empty(),V.id_3)
G.id_3 = alt(seq(terminal('t_Abstract'),V.id_3_sec),seq(V.Concrete,V.id_3_sec))
G.Concrete = V.id_4
G.id_4_sec = alt(empty(),V.id_4)
G.id_4 = alt(seq(terminal('t_Textual'),V.id_4_sec),seq(terminal('t_Graphical'),V.id_4_sec))
G.Typing = V.id_5
G.id_5 = alt(terminal('t_Untyped'),terminal('t_Syntactically_typed'),terminal('t_Semantically_typed'))
G.Logic = V.id_6
G.id_6_sec = alt(empty(),V.id_6)
G.id_6 = alt(seq(terminal('t_Non_executable'),V.id_6_sec),seq(V.Executable,V.id_6_sec))
G.Executable = V.id_7
G.id_7_sec = alt(empty(),V.id_7)
G.id_7 = alt(seq(terminal('t_Imperative'),V.id_7_sec),seq(terminal('t_Declarative'),V.id_7_sec))
G.Rule_application_scoping = V.id_8
G.id_8_sec = alt(empty(),V.id_8)
G.id_8 = alt(seq(terminal('t_Source'),V.id_8_sec),seq(terminal('t_Target'),V.id_8_sec))
G.Source_Target_relationship = V.id_9
G.id_9_sec = alt(empty(),V.id_9)
G.id_9 = alt(seq(terminal('t_New_target'),V.id_9_sec),seq(V.Existing_target,V.id_9_sec))
G.Existing_target = alt(V.Update,seq(V.Update,terminal('t_In_place')))
G.Update = V.id_10
G.id_10 = alt(terminal('t_Destructive'),terminal('t_Extension_only'))
G.Rule_application_strategy = V.id_11
G.id_11_sec = alt(empty(),V.id_11)
G.id_11 = alt(seq(terminal('t_Deterministic'),V.id_11_sec),seq(V.Non_deterministic,V.id_11_sec),seq(terminal('t_Interactive'),V.id_11_sec))
G.Non_deterministic = V.id_12
G.id_12_sec = alt(empty(),V.id_12)
G.id_12 = alt(seq(terminal('t_Concurrent'),V.id_12_sec),seq(terminal('t_One_point'),V.id_12_sec))
G.Rule_scheduling = alt(seq(V.Form_RS,V.Rule_selection),seq(V.Form_RS,seq(V.Rule_selection,V.Rule_Iteration)),terminal('t_Phasing'))
G.Form_RS = V.id_13
G.id_13_sec = alt(empty(),V.id_13)
G.id_13 = alt(seq(terminal('t_Implicit'),V.id_13_sec),seq(V.Explicit,V.id_13_sec))
G.Explicit = V.id_14
G.id_14 = alt(terminal('t_Internal'),terminal('t_External'))
G.Rule_selection = V.id_15
G.id_15_sec = alt(empty(),V.id_15)
G.id_15 = alt(seq(terminal('t_Explicit_condition'),V.id_15_sec),seq(terminal('t_Non_determinism'),V.id_15_sec),seq(terminal('t_Conflict_resolution'),V.id_15_sec),seq(terminal('t_Interactive'),V.id_15_sec))
G.Rule_Iteration = V.id_16
G.id_16 = alt(terminal('t_Recursion'),terminal('t_Looping'),terminal('t_Fixpoint_Iteration'))
G.Rule_organization = alt(V.Organizational_Structure,seq(V.Organizational_Structure,terminal('t_Modulatiry_mechanisms')),V.Reuse_mechanisms)
G.Reuse_mechanisms = V.id_17
G.id_17_sec = alt(empty(),V.id_17)
G.id_17 = alt(seq(terminal('t_Inheritance'),V.id_17_sec),seq(terminal('t_Logical_composition'),V.id_17_sec))
G.Organizational_Structure = V.id_18
G.id_18 = alt(terminal('t_Source_oriented'),terminal('t_Target_oriented'),terminal('t_Independent'))
G.Tracing = V.Dedicated_support
G.Dedicated_support = seq(V.Storage_location,V.Control)
G.Storage_location = V.id_19
G.id_19 = alt(V.Model,terminal('t_Separate'))
G.Model = V.id_20
G.id_20_sec = alt(empty(),V.id_20)
G.id_20 = alt(seq(terminal('t_Source'),V.id_20_sec),seq(terminal('t_Target'),V.id_20_sec))
G.Control = V.id_21
G.id_21 = alt(terminal('t_Manual'),V.Automatic)
G.Automatic = V.id_22
G.id_22 = alt(terminal('t_All_rules'),terminal('t_Selected_rules'))
G.Directionality = V.id_23
G.id_23_sec = alt(empty(),V.id_23)
G.id_23 = alt(seq(terminal('t_Unidirectional'),V.id_23_sec),seq(V.Bidirectional,V.id_23_sec))
G.Bidirectional = V.id_24
G.id_24 = alt(terminal('t_Bidirectional_rules'),terminal('t_Complementary_pairs'))
  • ATM
G.startSymbol = "ATMsoftware"

G.ATMsoftware = alt(seq(V.UserInterface,V.Bankingfunctionality),seq(V.UserInterface,seq(V.Bankingfunctionality,V.Additionalfunctionality)))
G.UserInterface = V.r_1_5
G.r_1_5 = alt(terminal('t_Basic2Dview'),terminal('t_Deluxe3Dview'))
G.Bankingfunctionality = alt(seq(terminal('t_Checkingbalance'),seq(terminal('t_Withdrawnmoney'),seq(terminal('t_Viewtransaction'),seq(terminal('t_Changeaccountpassword'),terminal('t_Printingbalanceafterwithdrawal'))))),seq(terminal('t_Checkingbalance'),seq(terminal('t_Withdrawnmoney'),seq(terminal('t_Viewtransaction'),seq(terminal('t_Changeaccountpassword'),seq(terminal('t_Printingbalanceafterwithdrawal'),terminal('t_Depositmoney')))))),terminal('t_Printingstatement'),terminal('t_Changemaximumlimitforwithdrawal'),terminal('t_Localtransfertothesamebank'),V.Localtransfertootherbanks,terminal('t_Internationaltransfer'),terminal('t_Moneyexchange'),terminal('t_Checkingmoneyexchangerate'))
G.Localtransfertootherbanks = V.r_2_16_17
G.r_2_16_17_sec = alt(empty(),V.r_2_16_17)
G.r_2_16_17 = alt(seq(terminal('t_Detuschbank'),V.r_2_16_17_sec),seq(terminal('t_Stadtparkasse'),V.r_2_16_17_sec),seq(terminal('t_Volksbank'),V.r_2_16_17_sec))
G.Additionalfunctionality = alt(terminal('t_Mobiletop_up'),terminal('t_Paythebills'),V.Languageselection)
G.Languageselection = V.r_4_30_31
G.r_4_30_31 = alt(terminal('t_German'),terminal('t_English'),terminal('t_French'),terminal('t_Italian'))
  • Mobile Phone
G.startSymbol = "MobilePhone"

G.MobilePhone = alt(seq(V.UtilityFunctions,V.Settings),seq(V.UtilityFunctions,seq(V.Settings,V.Media)),V.Connectivity)
G.LHS_Games = seq(terminal('t_Games'),terminal('t_JavaSupport'))
G.UtilityFunctions = alt(seq(terminal('t_Calls'),seq(V.Messaging,seq(terminal('t_Alarm'),terminal('t_RingingTones')))),seq(terminal('t_Calls'),seq(V.Messaging,seq(terminal('t_Alarm'),seq(terminal('t_RingingTones'),V.LHS_Games)))))
G.Messaging = V.r_1_3_5
G.r_1_3_5_sec = alt(empty(),V.r_1_3_5)
G.r_1_3_5 = alt(seq(terminal('t_SMS'),V.r_1_3_5_sec),seq(terminal('t_MMS'),V.r_1_3_5_sec))
G.LHS_JavaSupport = seq(terminal('t_JavaSupport'),terminal('t_Games'))
G.Settings = alt(V.OS,seq(V.OS,V.LHS_JavaSupport))
G.OS = V.r_11_12_14
G.r_11_12_14 = alt(terminal('t_Symbian'),terminal('t_WinCE'))
G.Media = alt(terminal('t_Camera'),seq(terminal('t_Camera'),terminal('t_MP3')))
G.Connectivity = alt(terminal('t_USB'),seq(terminal('t_USB'),terminal('t_Bluetooth')))
  • Digital Video System
G.startSymbol = "dvs"

G.dvs = alt(seq(V.control,seq(V.server_pc,V.play)),seq(V.control,seq(V.server_pc,seq(V.play,V.LHS_network_hw))),V.client_pc,V.LHS_handheld)
G.LHS_network_hw = seq(V.network_hw,V.net)
G.LHS_handheld = seq(terminal('t_handheld'),terminal('t_irda_port'))
G.LHS_net = seq(V.net,V.network_hw)
G.control = alt(seq(terminal('t_remote'),V.play1),seq(terminal('t_remote'),seq(V.play1,V.telephone)),V.LHS_net,V.edit)
G.telephone = terminal('t_sms')
G.net = alt(terminal('t_email'),seq(terminal('t_email'),terminal('t_web')),terminal('t_wap'))
G.LHS_add_music = seq(terminal('t_add_music'),terminal('t_audio'))
G.edit = V.LHS_add_music
G.LHS_audio = seq(terminal('t_audio'),terminal('t_add_music'))
G.play1 = alt(terminal('t_video'),seq(terminal('t_video'),terminal('t_slides')),V.LHS_audio)
G.network_hw = alt(terminal('t_modem'),terminal('t_ethernet'))
G.LHS_irda_port = seq(terminal('t_irda_port'),terminal('t_handheld'))
G.server_pc = alt(terminal('t_network'),V.LHS_irda_port)
G.play = terminal('t_on_demand')
G.client_pc = terminal('t_network')

Testing firewall

  • Firewall
G.startSymbol = "S"

G.S = seq(V.NSEPARATOR,seq(V.NBadFlags0,seq(V.NSYN,seq(V.NBadFlags1,seq(V.NSYNACK,seq(V.NBadFlags2,seq(V.NACK1,seq(V.NBadFlags3,seq(V.NFINACK1,seq(V.NBadFlags4,seq(V.NFINACK2,seq(V.NBadFlags5,seq(V.NACK2,V.NBadFlags6)))))))))))))
G.NSEPARATOR = terminal('! ! ! ! ! ! ! ! !')
G.NSYN = seq(terminal('\\n'),seq(terminal('SYN'),seq(terminal('SYN'),seq(terminal('ack'),seq(terminal('fin'),seq(terminal('psh'),seq(terminal('rst'),seq(terminal('urg'),seq(terminal('OUT'),terminal('ACCEPT'))))))))))
G.NSYNACK = seq(terminal('\\n'),seq(terminal('SYNACK'),seq(terminal('SYN'),seq(terminal('ACK'),seq(terminal('fin'),seq(terminal('psh'),seq(terminal('rst'),seq(terminal('urg'),seq(terminal('IN'),terminal('ACCEPT'))))))))))
G.NACK1 = seq(terminal('\\n'),seq(terminal('ACK1'),seq(terminal('syn'),seq(terminal('ACK'),seq(terminal('fin'),seq(terminal('psh'),seq(terminal('rst'),seq(terminal('urg'),seq(terminal('OUT'),terminal('ACCEPT'))))))))))
G.NFINACK1 = seq(terminal('\\n'),seq(terminal('FINACK1'),seq(terminal('syn'),seq(terminal('ACK'),seq(terminal('FIN'),seq(terminal('psh'),seq(terminal('rst'),seq(terminal('urg'),seq(terminal('IN'),terminal('ACCEPT'))))))))))
G.NFINACK2 = seq(terminal('\\n'),seq(terminal('FINACK2'),seq(terminal('syn'),seq(terminal('ACK'),seq(terminal('FIN'),seq(terminal('psh'),seq(terminal('rst'),seq(terminal('urg'),seq(terminal('OUT'),terminal('ACCEPT'))))))))))
G.NACK2 = seq(terminal('\\n'),seq(terminal('ACK2'),seq(terminal('syn'),seq(terminal('ACK'),seq(terminal('fin'),seq(terminal('psh'),seq(terminal('rst'),seq(terminal('urg'),seq(terminal('IN'),terminal('ACCEPT'))))))))))
G.NBadFlags0 = V.NBadFlag0
G.NBadFlag0 = seq(terminal('\\n'),seq(terminal('badFlag0'),seq(V.StaticBadFlags,seq(terminal('IN'),terminal('DROP')))))
G.NBadFlags1 = seq(terminal('\\n'),seq(terminal('badFlag1'),seq(V.NFlag1,seq(terminal('IN'),terminal('DROP')))))
G.NFlag1 = V.StaticBadFlags
G.NBadFlags2 = seq(terminal('\\n'),seq(terminal('badFlag2'),seq(V.NFlag2,seq(terminal('IN'),terminal('DROP')))))
G.NFlag2 = V.StaticBadFlags
G.NBadFlags3 = seq(terminal('\\n'),seq(terminal('badFlag3'),seq(V.NFlag3,seq(terminal('IN'),terminal('DROP')))))
G.NFlag3 = V.StaticBadFlags
G.NBadFlags4 = seq(terminal('\\n'),seq(terminal('badFlag4'),seq(V.NFlag4,seq(terminal('IN'),terminal('DROP')))))
G.NFlag4 = V.StaticBadFlags
G.NBadFlags5 = seq(terminal('\\n'),seq(terminal('badFlag5'),seq(V.NFlag5,seq(terminal('IN'),terminal('DROP')))))
G.NFlag5 = V.StaticBadFlags
G.NBadFlags6 = seq(terminal('\\n'),seq(terminal('badFlag6'),seq(V.NFlag6,seq(terminal('IN'),terminal('DROP')))))
G.NFlag6 = V.StaticBadFlags
G.StaticBadFlags = alt(seq(terminal('SYN'),seq(terminal('ACK'),seq(terminal('fin'),seq(terminal('psh'),seq(terminal('rst'),terminal('urg')))))),seq(terminal('SYN'),seq(terminal('ACK'),seq(terminal('FIN'),seq(terminal('psh'),seq(terminal('rst'),terminal('urg')))))),seq(terminal('SYN'),seq(terminal('ACK'),seq(terminal('FIN'),seq(terminal('PSH'),seq(terminal('rst'),terminal('urg')))))),seq(terminal('SYN'),seq(terminal('ACK'),seq(terminal('FIN'),seq(terminal('PSH'),seq(terminal('RST'),terminal('urg')))))),seq(terminal('SYN'),seq(terminal('ACK'),seq(terminal('FIN'),seq(terminal('PSH'),seq(terminal('RST'),terminal('URG')))))),seq(terminal('SYN'),seq(terminal('ACK'),seq(terminal('FIN'),seq(terminal('psh'),seq(terminal('RST'),terminal('urg')))))),seq(terminal('SYN'),seq(terminal('ACK'),seq(terminal('FIN'),seq(terminal('psh'),seq(terminal('rst'),terminal('URG')))))),seq(terminal('SYN'),seq(terminal('ACK'),seq(terminal('FIN'),seq(terminal('psh'),seq(terminal('RST'),terminal('URG')))))),seq(terminal('SYN'),seq(terminal('ACK'),seq(terminal('FIN'),seq(terminal('PSH'),seq(terminal('rst'),terminal('URG')))))),seq(terminal('SYN'),seq(terminal('ACK'),seq(terminal('FIN'),seq(terminal('psh'),seq(terminal('RST'),terminal('URG')))))),seq(terminal('SYN'),seq(terminal('ACK'),seq(terminal('fin'),seq(terminal('PSH'),seq(terminal('RST'),terminal('URG')))))),seq(terminal('SYN'),seq(terminal('ACK'),seq(terminal('fin'),seq(terminal('PSH'),seq(terminal('RST'),terminal('URG')))))),seq(terminal('SYN'),seq(terminal('ACK'),seq(terminal('fin'),seq(terminal('psh'),seq(terminal('RST'),terminal('urg')))))),seq(terminal('SYN'),seq(terminal('ACK'),seq(terminal('fin'),seq(terminal('psh'),seq(terminal('RST'),terminal('URG')))))),seq(terminal('SYN'),seq(terminal('ACK'),seq(terminal('fin'),seq(terminal('psh'),seq(terminal('rst'),terminal('URG')))))),seq(terminal('SYN'),seq(terminal('ACK'),seq(terminal('fin'),seq(terminal('PSH'),seq(terminal('rst'),terminal('urg')))))),seq(terminal('SYN'),seq(terminal('ack'),seq(terminal('fin'),seq(terminal('psh'),seq(terminal('rst'),terminal('urg')))))),seq(terminal('SYN'),seq(terminal('ACK'),seq(terminal('fin'),seq(terminal('PSH'),seq(terminal('RST'),terminal('urg')))))),seq(terminal('SYN'),seq(terminal('ack'),seq(terminal('FIN'),seq(terminal('PSH'),seq(terminal('RST'),terminal('URG')))))),seq(terminal('SYN'),seq(terminal('ack'),seq(terminal('FIN'),seq(terminal('psh'),seq(terminal('RST'),terminal('urg')))))),seq(terminal('SYN'),seq(terminal('ack'),seq(terminal('fin'),seq(terminal('psh'),seq(terminal('RST'),terminal('urg')))))),seq(terminal('SYN'),seq(terminal('ack'),seq(terminal('fin'),seq(terminal('psh'),seq(terminal('rst'),terminal('URG')))))),seq(terminal('SYN'),seq(terminal('ack'),seq(terminal('FIN'),seq(terminal('PSH'),seq(terminal('rst'),terminal('urg')))))),seq(terminal('SYN'),seq(terminal('ack'),seq(terminal('fin'),seq(terminal('PSH'),seq(terminal('rst'),terminal('urg')))))),seq(terminal('SYN'),seq(terminal('ack'),seq(terminal('FIN'),seq(terminal('PSH'),seq(terminal('rst'),terminal('URG')))))),seq(terminal('SYN'),seq(terminal('ack'),seq(terminal('FIN'),seq(terminal('PSH'),seq(terminal('RST'),terminal('urg')))))),seq(terminal('SYN'),seq(terminal('ack'),seq(terminal('FIN'),seq(terminal('psh'),seq(terminal('RST'),terminal('URG')))))),seq(terminal('SYN'),seq(terminal('ack'),seq(terminal('fin'),seq(terminal('PSH'),seq(terminal('RST'),terminal('URG')))))),seq(terminal('SYN'),seq(terminal('ack'),seq(terminal('fin'),seq(terminal('PSH'),seq(terminal('RST'),terminal('urg')))))),seq(terminal('SYN'),seq(terminal('ack'),seq(terminal('FIN'),seq(terminal('psh'),seq(terminal('rst'),terminal('urg')))))),seq(terminal('SYN'),seq(terminal('ack'),seq(terminal('fin'),seq(terminal('psh'),seq(terminal('RST'),terminal('URG')))))),seq(terminal('SYN'),seq(terminal('ack'),seq(terminal('fin'),seq(terminal('PSH'),seq(terminal('rst'),terminal('URG')))))),seq(terminal('syn'),seq(terminal('ack'),seq(terminal('fin'),seq(terminal('psh'),seq(terminal('rst'),terminal('urg')))))),seq(terminal('syn'),seq(terminal('ack'),seq(terminal('fin'),seq(terminal('psh'),seq(terminal('rst'),terminal('URG')))))),seq(terminal('syn'),seq(terminal('ack'),seq(terminal('fin'),seq(terminal('psh'),seq(terminal('RST'),terminal('URG')))))),seq(terminal('syn'),seq(terminal('ack'),seq(terminal('fin'),seq(terminal('PSH'),seq(terminal('RST'),terminal('URG')))))),seq(terminal('syn'),seq(terminal('ack'),seq(terminal('fin'),seq(terminal('PSH'),seq(terminal('rst'),terminal('urg')))))),seq(terminal('syn'),seq(terminal('ack'),seq(terminal('fin'),seq(terminal('psh'),seq(terminal('RST'),terminal('urg')))))),seq(terminal('syn'),seq(terminal('ack'),seq(terminal('fin'),seq(terminal('psh'),seq(terminal('rst'),terminal('URG')))))),seq(terminal('syn'),seq(terminal('ack'),seq(terminal('FIN'),seq(terminal('PSH'),seq(terminal('RST'),terminal('URG')))))),seq(terminal('syn'),seq(terminal('ack'),seq(terminal('FIN'),seq(terminal('psh'),seq(terminal('rst'),terminal('urg')))))),seq(terminal('syn'),seq(terminal('ack'),seq(terminal('FIN'),seq(terminal('psh'),seq(terminal('RST'),terminal('urg')))))),seq(terminal('syn'),seq(terminal('ack'),seq(terminal('FIN'),seq(terminal('PSH'),seq(terminal('rst'),terminal('urg')))))),seq(terminal('syn'),seq(terminal('ack'),seq(terminal('FIN'),seq(terminal('psh'),seq(terminal('rst'),terminal('URG')))))),seq(terminal('syn'),seq(terminal('ack'),seq(terminal('FIN'),seq(terminal('psh'),seq(terminal('RST'),terminal('URG')))))),seq(terminal('syn'),seq(terminal('ack'),seq(terminal('FIN'),seq(terminal('PSH'),seq(terminal('RST'),terminal('urg')))))),seq(terminal('syn'),seq(terminal('ack'),seq(terminal('fin'),seq(terminal('PSH'),seq(terminal('RST'),terminal('urg')))))),seq(terminal('syn'),seq(terminal('ack'),seq(terminal('FIN'),seq(terminal('PSH'),seq(terminal('rst'),terminal('URG')))))),seq(terminal('syn'),seq(terminal('ACK'),seq(terminal('fin'),seq(terminal('psh'),seq(terminal('rst'),terminal('urg')))))),seq(terminal('syn'),seq(terminal('ACK'),seq(terminal('fin'),seq(terminal('psh'),seq(terminal('rst'),terminal('URG')))))),seq(terminal('syn'),seq(terminal('ACK'),seq(terminal('fin'),seq(terminal('psh'),seq(terminal('RST'),terminal('URG')))))),seq(terminal('syn'),seq(terminal('ACK'),seq(terminal('fin'),seq(terminal('psh'),seq(terminal('RST'),terminal('urg')))))),seq(terminal('syn'),seq(terminal('ACK'),seq(terminal('fin'),seq(terminal('PSH'),seq(terminal('rst'),terminal('urg')))))),seq(terminal('syn'),seq(terminal('ACK'),seq(terminal('fin'),seq(terminal('PSH'),seq(terminal('rst'),terminal('URG')))))),seq(terminal('syn'),seq(terminal('ACK'),seq(terminal('fin'),seq(terminal('PSH'),seq(terminal('RST'),terminal('URG')))))),seq(terminal('syn'),seq(terminal('ACK'),seq(terminal('fin'),seq(terminal('PSH'),seq(terminal('RST'),terminal('urg')))))),seq(terminal('syn'),seq(terminal('ACK'),seq(terminal('FIN'),seq(terminal('psh'),seq(terminal('rst'),terminal('urg')))))),seq(terminal('syn'),seq(terminal('ACK'),seq(terminal('FIN'),seq(terminal('psh'),seq(terminal('rst'),terminal('URG')))))),seq(terminal('syn'),seq(terminal('ACK'),seq(terminal('FIN'),seq(terminal('psh'),seq(terminal('RST'),terminal('URG')))))),seq(terminal('syn'),seq(terminal('ACK'),seq(terminal('FIN'),seq(terminal('psh'),seq(terminal('RST'),terminal('urg')))))),seq(terminal('syn'),seq(terminal('ACK'),seq(terminal('FIN'),seq(terminal('PSH'),seq(terminal('rst'),terminal('urg')))))),seq(terminal('syn'),seq(terminal('ACK'),seq(terminal('FIN'),seq(terminal('PSH'),seq(terminal('RST'),terminal('urg')))))),seq(terminal('syn'),seq(terminal('ACK'),seq(terminal('FIN'),seq(terminal('PSH'),seq(terminal('RST'),terminal('URG')))))),seq(terminal('syn'),seq(terminal('ACK'),seq(terminal('FIN'),seq(terminal('PSH'),seq(terminal('rst'),terminal('URG')))))))

RSS feed parser

  • RSS
G.startSymbol = "probes"

G.probes = seq(V.titleprobe,seq(V.rightsprobe,seq(V.linkprobe,V.linkprobe)))
G.titleprobe = seq(V.type,seq(V.html,V.html))
G.rightsprobe = seq(V.type,seq(V.html,V.html))
G.linkprobe = seq(V.type,seq(V.html,V.html))
G.type = alt(terminal('>'),seq(terminal('type='),seq(V.html,terminal('>'))))
G.lt = terminal('&lt')
G.gt = terminal('&gt')
G.html = alt(seq(V.lt,seq(terminal('script'),seq(V.attr,seq(V.gt,seq(V.lt,seq(terminal('/script'),V.gt)))))),seq(V.lt,seq(terminal('applet'),seq(V.attr,seq(V.gt,seq(V.lt,seq(terminal('/applet'),V.gt)))))),seq(V.lt,seq(terminal('embed'),seq(V.attr,seq(V.gt,seq(V.lt,seq(terminal('/embed'),V.gt)))))),seq(V.lt,seq(terminal('object'),seq(V.attr,seq(V.gt,seq(V.lt,seq(terminal('/object'),V.gt)))))),seq(V.lt,seq(terminal('meta'),seq(V.attr,seq(V.gt,seq(V.lt,seq(terminal('/meta'),V.gt)))))),seq(V.lt,seq(terminal('a'),seq(V.attr,seq(V.gt,seq(V.lt,seq(terminal('/a'),V.gt)))))))
G.attr = alt(terminal('""'),seq(terminal('style'),V.valueempty),seq(terminal('abbr'),V.valueempty))
G.valueempty = seq(terminal('='),terminal('""'))

Image processing

  • PI
G.startSymbol = "S"
G.S = alt(seq(V.z,V.A),seq(V.z,V.S))
G.A = alt(seq(V.x,V.A),seq(V.x,V.B))
G.B = alt(seq(V.z,V.B),seq(V.z,V.C))
G.C = alt(empty(),V.S)
G.z = terminal('0')
G.x = alt(terminal('1'),terminal('2'),terminal('3'),terminal('4'),terminal('5'),terminal('6'),terminal('7'),terminal('8'),terminal('9'))

Internet Telephony software (VoiP)

  • Call
G.startSymbol = 'Call'
G.Call = seq(V.CallerOS, seq(V.ServerOS, V.CalleeOS))
G.CallerOS= alt( terminal('Mac'), terminal('Win'))
G.ServerOS= alt( terminal('Lin'), terminal('Sun'), terminal('Win'))
G.CalleeOS= alt( terminal('Mac'), terminal('Win'))

B notation

  • b_grammar_small
G.startSymbol = "Component"

G.Component = V.Machine_abstract
G.Machine_abstract = seq(terminal("MACHINE"),seq(V.Header,seq(zeroOrMore(V.Clause_machine_abstract),terminal("END"))))
G.Header = V.Ident
G.Clause_machine_abstract = alt(V.Clause_abstract_variables,V.Clause_operations)
G.Clause_abstract_variables = seq(terminal("VARIABLES"),oneOrMoreSep(Ident, ","))
G.Clause_operations = seq(terminal("OPERATIONS"),oneOrMoreSep(Operation, ";"))
G.Operation = seq(V.Header_operation,seq(terminal("="),V.Level1_substitution))
G.Header_operation = seq(optional(seq(oneOrMoreSep(Ident, ","),terminal("<--"))),seq(oneOrMoreSep(Ident, "."),optional(seq(terminal("("),seq(oneOrMoreSep(Ident, ","),terminal(")"))))))
G.Level1_substitution = alt(V.Identity_substitution,V.Becomes_equal_substitution)
G.Identity_substitution = terminal("skip")
G.Becomes_equal_substitution = alt(seq(oneOrMoreSep(oneOrMoreSep(Ident, "."), ","),seq(terminal(":="),oneOrMoreSep(Expression, ","))),seq(oneOrMoreSep(Ident, "."),seq(terminal("("),seq(oneOrMoreSep(Expression, ","),seq(terminal(")"),seq(terminal(":="),V.Expression))))))
G.Expression = alt(V.Expressions_primary,V.Expressions_boolean)
G.Expressions_primary = V.Data
G.Expressions_boolean = V.Boolean_lit
G.Boolean_lit = alt(terminal("FALSE"),terminal("TRUE"))
G.Data = alt(oneOrMoreSep(Ident, "."),seq(oneOrMoreSep(Ident, "."),terminal("$0")))
G.Ident = terminal("ID")
  • b_grammar_ext
G.startSymbol = "Component"

G.Component = V.Machine_abstract
G.Machine_abstract = seq(terminal("MACHINE"), seq(V.Header, seq(V.Machine_abstractVRZ, terminal("END"))))
G.Machine_abstractVRZ = alt(empty(), seq(V.Clause_machine_abstract, V.Machine_abstractVRZ))
G.Header = seq(V.Ident, optional(seq(terminal("("), seq(oneOrMoreSep(V.Ident, ","), terminal(")")))))
G.Clause_machine_abstract = alt(V.Clause_constraints, V.Clause_abstract_variables,
                                V.Clause_invariant, V.Clause_initialization,
                                                                V.Clause_operations)
G.Clause_constraints = seq(terminal("CONSTRAINTS"), oneOrMoreSep(V.Predicate, "&"))
G.Clause_abstract_variables = alt(seq(terminal("ABSTRACT_VARIABLES"), oneOrMoreSep(V.Ident, ",")), seq(terminal("VARIABLES"), oneOrMoreSep(V.Ident, ",")))
G.Clause_invariant = seq(terminal("INVARIANT"), oneOrMoreSep(V.Predicate, "&"))
G.Clause_initialization = seq(terminal("INITIALISATION"), V.Substitution)
G.Clause_operations = seq(terminal("OPERATIONS"), oneOrMoreSep(V.Operation, ";"))
G.Operation = seq(V.Header_operation, seq(terminal("="), V.Level1_substitution))
G.Header_operation = seq(optional(seq(oneOrMoreSep(V.Ident, ","), terminal("<--"))), seq(oneOrMoreSep(V.Ident, "."), optional(seq(terminal("("), seq(oneOrMoreSep(V.Ident, ","), terminal(")"))))))
G.Substitution = alt(V.Level1_substitution, V.Simultaneous_substitution,
                     V.Sequence_substitution)
G.Simultaneous_substitution = seq(V.Substitution, seq(terminal("||"), V.Substitution))
G.Sequence_substitution = seq(V.Substitution, seq(terminal(";"), V.Substitution))
G.Level1_substitution = alt(V.Identity_substitution, V.Becomes_equal_substitution,
                            V.Becomes_elt_substitution)
G.Identity_substitution = terminal("skip")
G.Becomes_equal_substitution = alt(seq(oneOrMoreSep(oneOrMoreSep(V.Ident, "."), ","), seq(terminal(":="), oneOrMoreSep(V.Expression, ","))), seq(oneOrMoreSep(V.Ident, "."), seq(terminal("("), seq(oneOrMoreSep(V.Expression, ","), seq(terminal(")"), seq(terminal(":="), V.Expression))))))
G.Becomes_elt_substitution = seq(oneOrMoreSep(oneOrMoreSep(V.Ident, "."), ","), seq(terminal("::"), V.Expression))
G.Predicate = alt(V.Bracketed_predicate, V.Conjunction_predicate,
                  V.Negation_predicate, V.Implication_predicate,
                                    V.Universal_predicate, V.Existential_predicate,
                                    V.Equals_predicate, V.Belongs_predicate)
G.Bracketed_predicate = seq(terminal("("), seq(V.Predicate, terminal(")")))
G.Conjunction_predicate = seq(V.Predicate, seq(terminal("&"), V.Predicate))
G.Negation_predicate = seq(terminal("not"), seq(terminal("("), seq(V.Predicate, terminal(")"))))
G.Implication_predicate = seq(V.Predicate, seq(terminal("=>"), V.Predicate))
G.Universal_predicate = seq(terminal("!"), seq(V.List_ident, seq(terminal("."), seq(terminal("("), seq(V.Predicate, seq(terminal("=>"), seq(V.Predicate, terminal(")"))))))))
G.Existential_predicate = seq(terminal("#"), seq(V.List_ident, seq(terminal("."), seq(terminal("("), seq(V.Predicate, terminal(")"))))))
G.Equals_predicate = seq(V.Expression, seq(terminal("="), V.Expression))
G.Belongs_predicate = seq(V.Expression, seq(terminal(":"), V.Expression))
G.Expression = alt(V.Expressions_primary, V.Expressions_boolean,
                   V.Expressions_of_functionss)
G.Expressions_primary = alt(V.Data, V.Expr_bracketed)
G.Expressions_boolean = alt(V.Boolean_lit, V.Conversion_Bool)
G.Boolean_lit = alt(terminal("FALSE"), terminal("TRUE"))
G.Conversion_Bool = seq(terminal("bool"), seq(terminal("("), seq(V.Predicate, terminal(")"))))
G.Expressions_of_functionss = alt(V.Partial_functions, V.Total_functions)
G.Partial_functions = seq(V.Expression, seq(terminal("+->"), V.Expression))
G.Total_functions = seq(V.Expression, seq(terminal("-->"), V.Expression))
G.Data = alt(oneOrMoreSep(V.Ident, "."), seq(oneOrMoreSep(V.Ident, "."), terminal("$0")))
G.Expr_bracketed = seq(terminal("("), seq(V.Expression, terminal(")")))
G.Ident = terminal("ID")
G.List_ident = alt(V.Ident, seq(terminal("("), seq(oneOrMoreSep(V.Ident, ","), terminal(")"))))
  • b_grammar_full
G.startSymbol = "Component"

G.Component = alt(V.Machine_abstract , V.Refinement, V.Implementation)
G.Machine_abstract = seq(terminal("MACHINE"), seq(V.Header, seq(V.Machine_abstractVRZ, terminal("END"))))
G.Machine_abstractVRZ = alt(empty(), seq(V.Clause_machine_abstract, V.Machine_abstractVRZ))
G.Clause_machine_abstract = alt(V.Clause_constraints , V.Clause_sees, V.Clause_includes, V.Clause_promotes, V.Clause_EXTENDS, V.Clause_uses, V.Clause_sets, V.Clause_concrete_constants, V.Clause_abstract_constants, V.Clause_properties, V.Clause_concrete_variables, V.Clause_abstract_variables, V.Clause_invariant, V.Clause_assertions, V.Clause_initialization, V.Clause_operations)
G.Header = seq(V.Ident, optional(seq(terminal("("), seq(oneOrMoreSep(V.Ident, ","), terminal(")")))))
G.Refinement = seq(terminal("REFINEMENT"), seq(V.Header, seq(V.Clause_refines, seq(V.RefinementVRZ, terminal("END")))))
G.RefinementVRZ = alt(empty(), seq(V.Clause_refinement, V.RefinementVRZ))
G.Clause_refinement = alt(V.Clause_sees , V.Clause_includes, V.Clause_promotes, V.Clause_EXTENDS, V.Clause_sets, V.Clause_concrete_constants, V.Clause_abstract_constants, V.Clause_properties, V.Clause_concrete_variables, V.Clause_abstract_variables, V.Clause_invariant, V.Clause_assertions, V.Clause_initialization, V.Clause_operations)
G.Implementation = seq(terminal("IMPLEMENTATION"), seq(V.Header, seq(V.Clause_refines, seq(V.ImplementationVRZ, terminal("END")))))
G.ImplementationVRZ = alt(empty(), seq(V.Clause_implementation, V.ImplementationVRZ))
G.Clause_implementation = alt(V.Clause_sees , V.Clause_IMPORTS, V.Clause_promotes, V.Clause_EXTENDS_B0, V.Clause_sets, V.Clause_concrete_constants, V.Clause_properties, V.Clause_values, V.Clause_concrete_variables, V.Clause_invariant, V.Clause_assertions, V.Clause_initialization_B0, V.Clause_operations_B0)
G.Clause_constraints = seq(terminal("CONSTRAINTS"), oneOrMoreSep(V.Predicate, "&"))
G.Clause_refines = seq(terminal("REFINES"), V.Ident)
G.Clause_IMPORTS = seq(terminal("IMPORTS"), oneOrMoreSep(seq(optional(oneOrMoreSep(V.Ident, ".")), seq(V.Ident, optional(seq(terminal("("), seq(oneOrMoreSep(V.Instanciation_B0, ","), terminal(")")))))), ","))
G.Instanciation_B0 = alt(V.Term , V.Integer_set_B0, terminal("BOOL"), V.Interval)
G.Clause_sees = seq(terminal("SEES"), oneOrMoreSep(oneOrMoreSep(V.Ident, "."), ","))
G.Clause_includes = seq(terminal("INCLUDES"), oneOrMoreSep(seq(optional(seq(V.Ident, terminal("."))), seq(V.Ident, optional(seq(terminal("("), seq(oneOrMoreSep(V.Instanciation, ","), terminal(")")))))), ","))
G.Instanciation = alt(V.Term , V.Integer_set, terminal("BOOL"), V.Interval)
G.Clause_promotes = seq(terminal("PROMOTES"), oneOrMoreSep(oneOrMoreSep(V.Ident, "."), ","))
G.Clause_EXTENDS = seq(terminal("EXTENDS"), oneOrMoreSep(seq(optional(seq(V.Ident, terminal("."))), seq(V.Ident, optional(seq(terminal("("), seq(oneOrMoreSep(V.Instanciation, ","), terminal(")")))))), ","))
G.Clause_EXTENDS_B0 = seq(terminal("EXTENDS"), oneOrMoreSep(seq(optional(seq(V.Ident, terminal("."))), seq(V.Ident, optional(seq(terminal("("), seq(oneOrMoreSep(V.Instanciation_B0, ","), terminal(")")))))), ","))
G.Clause_uses = seq(terminal("USES"), oneOrMoreSep(seq(optional(seq(V.Ident, terminal("."))), V.Ident), ","))
G.Clause_sets = seq(terminal("SETS"), oneOrMoreSep(V.Set, ";"))
G.Set = alt(V.Ident, seq(V.Ident, seq(terminal("="), seq(terminal("{"), seq(oneOrMoreSep(V.Ident, ","), terminal("}"))))))
G.Clause_concrete_constants = alt(seq(terminal("CONCRETE_CONSTANTS"), oneOrMoreSep(V.Ident, ",")), seq(terminal("CONSTANTS"), oneOrMoreSep(V.Ident, ",")))
G.Clause_abstract_constants = seq(terminal("ABSTRACT_CONSTANTS"), oneOrMoreSep(V.Ident, ","))
G.Clause_properties = seq(terminal("PROPERTIES"), oneOrMoreSep(V.Predicate, "&"))
G.Clause_values = seq(terminal("VALUES"), oneOrMoreSep(V.Valuation, ";"))
G.Valuation = alt(seq(V.Ident, seq(terminal("="), V.Term)) , seq(V.Ident, seq(terminal("="), seq(terminal("Bool"), seq(terminal("("), seq(V.Condition, terminal(")")))))), seq(V.Ident, seq(terminal("="), V.Expr_array)), seq(V.Ident, seq(terminal("="), V.Interval_B0)))
G.Clause_concrete_variables = seq(terminal("CONCRETE_VARIABLES"), oneOrMoreSep(oneOrMoreSep(V.Ident, "."), ","))
G.Clause_abstract_variables = alt(seq(terminal("ABSTRACT_VARIABLES"), oneOrMoreSep(V.Ident, ",")), seq(terminal("VARIABLES"), oneOrMoreSep(V.Ident, ",")))
G.Clause_invariant = seq(terminal("INVARIANT"), oneOrMoreSep(V.Predicate, "&"))
G.Clause_assertions = seq(terminal("ASSERTIONS"), oneOrMoreSep(V.Predicate, ";"))
G.Clause_initialization = seq(terminal("INITIALISATION"), V.Substitution)
G.Clause_initialization_B0 = seq(terminal("INITIALISATION"), V.Instruction)
G.Clause_operations = seq(terminal("OPERATIONS"), oneOrMoreSep(V.Operation, ";"))
G.Operation = seq(V.Header_operation, seq(terminal("="), V.Level1_substitution))
G.Header_operation = seq(optional(seq(oneOrMoreSep(V.Ident, ","), terminal("<--"))), seq(oneOrMoreSep(V.Ident, "."), optional(seq(terminal("("), seq(oneOrMoreSep(V.Ident, ","), terminal(")"))))))
G.Clause_operations_B0 = seq(terminal("OPERATIONS"), oneOrMoreSep(V.Operation_B0, ";"))
G.Operation_B0 = seq(V.Header_operation, seq(terminal("="), V.Level1_substitution))
G.Term = alt(V.Simple_term , seq(oneOrMoreSep(V.Ident, "."), seq(terminal("("), seq(oneOrMoreSep(V.Term, ","), terminal(")")))), V.Arithmetical_expression)
G.Simple_term = alt(oneOrMoreSep(V.Ident, ".") , V.Integer_lit, V.Boolean_lit)
G.Integer_lit = alt(V.Integer_literal , terminal("MAXINT"), terminal("MININT"))
G.Boolean_lit = alt(terminal("FALSE"), terminal("TRUE"))
G.Arithmetical_expression = alt(V.Integer_lit , oneOrMoreSep(V.Ident, "."), seq(V.Arithmetical_expression, seq(terminal("+"), V.Arithmetical_expression)), seq(V.Arithmetical_expression, seq(terminal("-"), V.Arithmetical_expression)), seq(terminal("-"), V.Arithmetical_expression), seq(V.Arithmetical_expression, seq(terminal("*"), V.Arithmetical_expression)), seq(V.Arithmetical_expression, seq(terminal("/"), V.Arithmetical_expression)), seq(V.Arithmetical_expression, seq(terminal("mod"), V.Arithmetical_expression)), seq(V.Arithmetical_expression, seq(terminal("**"), V.Expressions_arithmetical)), seq(terminal("succ"), seq(terminal("("), seq(V.Arithmetical_expression, terminal(")")))), seq(terminal("pred"), seq(terminal("("), seq(V.Arithmetical_expression, terminal(")")))))
G.Expr_array = alt(V.Ident , seq(terminal("{"), seq(oneOrMoreSep(seq(oneOrMoreSep(V.Simple_term, "|->"), seq(terminal("|->"), V.Term)), ","), terminal("}"))), oneOrMoreSep(seq(oneOrMoreSep(V.Range2, "*"), seq(terminal("*"), seq(terminal("{"), seq(V.Term, terminal("}"))))), "or"))
G.Range2 = alt(V.Ident , V.Interval_B0, seq(terminal("{"), seq(oneOrMoreSep(V.Simple_term, ","), terminal("}"))))
G.Interval_B0 = alt(seq(V.Arithmetical_expression, seq(terminal(".."), V.Arithmetical_expression)), V.Integer_set_B0)
G.Integer_set_B0 = alt(terminal("NAT") , terminal("NAT1"), terminal("INT"))
G.Condition = alt(seq(V.Simple_term, seq(terminal("="), V.Simple_term)) , seq(V.Simple_term, seq(terminal("/="), V.Simple_term)), seq(V.Simple_term, seq(terminal("<"), V.Simple_term)), seq(V.Simple_term, seq(terminal(">"), V.Simple_term)), seq(V.Simple_term, seq(terminal("<="), V.Simple_term)), seq(V.Simple_term, seq(terminal(">="), V.Simple_term)), seq(V.Condition, seq(terminal("&"), V.Condition)), seq(V.Condition, seq(terminal("or"), V.Condition)), seq(terminal("not"), seq(terminal("("), seq(V.Condition, terminal(")")))))
G.Instruction = alt(V.Level1_instruction, V.Sequence_instruction)
G.Level1_instruction = alt(V.Block_instruction , V.Var_instruction, V.Identity_substitution, V.Become_equals_instruction, V.Callup_instruction, V.If_instruction, V.Case_instruction, V.Assert_instruction, V.While_substitution)
G.Block_instruction = seq(terminal("BEGIN"), seq(V.Instruction, terminal("END")))
G.Var_instruction = seq(terminal("VAR"), seq(oneOrMoreSep(V.Ident, ","), seq(terminal("IN"), seq(V.Instruction, terminal("END")))))
G.Become_equals_instruction = alt(seq(oneOrMoreSep(V.Ident, "."), seq(optional(seq(terminal("("), seq(oneOrMoreSep(V.Term, ","), terminal(")")))), seq(terminal(":="), V.Term))) , seq(oneOrMoreSep(V.Ident, "."), seq(terminal(":="), V.Expr_array)), seq(oneOrMoreSep(V.Ident, "."), seq(terminal(":="), seq(terminal("bool"), seq(terminal("("), seq(V.Condition, terminal(")")))))))
G.Callup_instruction = seq(optional(seq(oneOrMoreSep(oneOrMoreSep(V.Ident, "."), ","), terminal("<-"))), seq(oneOrMoreSep(V.Ident, "."), optional(seq(terminal("("), seq(oneOrMoreSep(alt(V.Term, V.String_lit), ","), terminal(")"))))))
G.Sequence_instruction = seq(V.Instruction, seq(terminal(";"), V.Instruction))
G.If_instruction = seq(terminal("IF"), seq(V.Condition, seq(terminal("THEN"), seq(V.Instruction, seq(V.If_instructionVRZ, seq(optional(seq(terminal("ELSE"), V.Instruction)), terminal("END")))))))
G.If_instructionVRZ = alt(empty(), seq(seq(terminal("ELSIF"), seq(V.Condition, seq(terminal("THEN"), V.Instruction))), V.If_instructionVRZ))
G.Case_instruction = seq(terminal("CASE"), seq(V.Simple_term, seq(terminal("OF"), seq(terminal("EITHER"), seq(oneOrMoreSep(V.Simple_term, ","), seq(terminal("THEN"), seq(V.Instruction, seq(V.Case_instructionVRZ, seq(optional(seq(terminal("ELSE"), V.Instruction)), seq(terminal("END"), terminal("END")))))))))))
G.Case_instructionVRZ = alt(empty(), seq(seq(terminal("OR"), seq(oneOrMoreSep(V.Simple_term, ","), seq(terminal("THEN"), V.Instruction))), V.Case_instructionVRZ))
G.Assert_instruction = seq(terminal("ASSERT"), seq(V.Predicate, seq(terminal("THEN"), seq(V.Instruction, terminal("END")))))
G.Predicate = alt(V.Bracketed_predicate , V.Conjunction_predicate, V.Negation_predicate, V.Disjunction_predicate, V.Implication_predicate, V.Equivalence_predicate, V.Universal_predicate, V.Existential_predicate, V.Equals_predicate, V.Unequals_predicate, V.Belongs_predicate, V.Non_belongs_predicate, V.Inclusion_predicate, V.Strict_inclusion_predicate, V.Non_inclusion_predicate, V.Non_strict_inclusion_predicate, V.Less_than_or_equal_predicate, V.Strictly_less_than_predicate, V.Greater_or_equal_predicate, V.Strictly_greater_predicate)
G.Bracketed_predicate = seq(terminal("("), seq(V.Predicate, terminal(")")))
G.Conjunction_predicate = seq(V.Predicate, seq(terminal("&"), V.Predicate))
G.Negation_predicate = seq(terminal("not"), seq(terminal("("), seq(V.Predicate, terminal(")"))))
G.Disjunction_predicate = seq(V.Predicate, seq(terminal("or"), V.Predicate))
G.Implication_predicate = seq(V.Predicate, seq(terminal("=>"), V.Predicate))
G.Equivalence_predicate = seq(V.Predicate, seq(terminal("<=>"), V.Predicate))
G.Universal_predicate = seq(terminal("!"), seq(V.List_ident, seq(terminal("."), seq(terminal("("), seq(V.Predicate, seq(terminal("=>"), seq(V.Predicate, terminal(")"))))))))
G.Existential_predicate = seq(terminal("#"), seq(V.List_ident, seq(terminal("."), seq(terminal("("), seq(V.Predicate, terminal(")"))))))
G.Equals_predicate = seq(V.Expression, seq(terminal("="), V.Expression))
G.Unequals_predicate = seq(V.Expression, seq(terminal("/="), V.Expression))
G.Belongs_predicate = seq(V.Expression, seq(terminal(":"), V.Expression))
G.Non_belongs_predicate = seq(V.Expression, seq(terminal("/:"), V.Expression))
G.Inclusion_predicate = seq(V.Expression, seq(terminal("<:"), V.Expression))
G.Strict_inclusion_predicate = seq(V.Expression, seq(terminal("<<:"), V.Expression))
G.Non_inclusion_predicate = seq(V.Expression, seq(terminal("/<:"), V.Expression))
G.Non_strict_inclusion_predicate = seq(V.Expression, seq(terminal("/<<:"), V.Expression))
G.Less_than_or_equal_predicate = seq(V.Expression, seq(terminal("<="), V.Expression))
G.Strictly_less_than_predicate = seq(V.Expression, seq(terminal("<"), V.Expression))
G.Greater_or_equal_predicate = seq(V.Expression, seq(terminal(">="), V.Expression))
G.Strictly_greater_predicate = seq(V.Expression, seq(terminal(">"), V.Expression))
G.Expression = alt(V.Expressions_primary , V.Expressions_boolean, V.Expressions_arithmetical, V.Expressions_of_couple, V.Expressions_of_sets, V.Construction_of_sets, V.Expressions_of_relations, V.Expressions_of_functionss, V.Construction_of_functionss, V.Expressions_of_sequences, V.Construction_of_sequences)
G.Expressions_primary = alt(V.Data, V.Expr_bracketed)
G.Expressions_boolean = alt(V.Boolean_lit, V.Conversion_Bool)
G.Expressions_arithmetical = alt(V.Integer_lit , V.Addition, V.Difference, V.Unary_minus, V.Product, V.Division, V.Modulo, V.Power_of, V.Sucessor, V.Predecessor, V.Maximum, V.Minimum, V.Cardinal, V.Generalized_sum, V.Generalized_product)
G.Expressions_of_couple = V.Couple
G.Expressions_of_sets = alt(V.Empty_set , V.Integer_set, V.Boolean_set, V.String_set)
G.Construction_of_sets = alt(V.Product , V.Comprehension_set, V.Subsets, V.Finite_subsets, V.Set_extension, V.Interval, V.Difference, V.Union, V.Intersection, V.Generalized_union, V.Generalized_intersection, V.Quantified_union, V.Quantified_intersection)
G.Expressions_of_relations = alt(V.Relations , V.Identify, V.Reverse, V.First_projection, V.Second_projection, V.Composition, V.Direct_product, V.Parallel_product, V.Iteration, V.Reflexive_closure, V.Closure, V.Domain, V.Range, V.Image, V.Domain_restriction, V.Domain_subtraction, V.Range_restriction, V.Range_subtraction, V.Overwrite)
G.Expressions_of_functionss = alt(V.Partial_functions , V.Total_functions, V.Partial_injections, V.Total_injections, V.Partial_surjections, V.Total_surjections, V.Total_bijections)
G.Construction_of_functionss = alt(V.Lambada_expression , V.Evaluation_functions, V.Transformed_function, V.Transformed_relation)
G.Expressions_of_sequences = alt(V.Sequences , V.Non_empty_sequences, V.Injective_sequences, V.Non_empty_inj_sequences, V.Permutations)
G.Construction_of_sequences = alt(V.Empty_sequence , V.Sequence_extension, V.Sequence_size, V.Sequence_first_element, V.Sequence_last_element, V.Sequence_front, V.Sequence_tail, V.Reverse_sequence, V.Concatenation, V.Insert_front, V.Insert_tail, V.Restrict_front, V.Restrict_tail, V.Generalized_concat)
G.Conversion_Bool = seq(terminal("bool"), seq(terminal("("), seq(V.Predicate, terminal(")"))))
G.Addition = seq(V.Expression, seq(terminal("+"), V.Expression))
G.Difference = seq(V.Expression, seq(terminal("-"), V.Expression))
G.Unary_minus = seq(terminal("-"), V.Expression)
G.Product = seq(V.Expression, seq(terminal("*"), V.Expression))
G.Division = seq(V.Expression, seq(terminal("/"), V.Expression))
G.Modulo = seq(V.Expression, seq(terminal("mod"), V.Expression))
G.Power_of = seq(V.Expression, seq(terminal("**"), V.Expression))
G.Sucessor = seq(terminal("succ"), optional(seq(terminal("("), seq(V.Expression, terminal(")")))))
G.Predecessor = seq(terminal("pred"), optional(seq(terminal("("), seq(V.Expression, terminal(")")))))
G.Maximum = seq(terminal("max"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Minimum = seq(terminal("max"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Cardinal = seq(terminal("card"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Generalized_sum = seq(terminal("SIGMA"), seq(V.List_ident, seq(terminal("."), seq(terminal("("), seq(V.Predicate, seq(terminal("|"), seq(V.Expression, terminal(")"))))))))
G.Generalized_product = seq(terminal("PI"), seq(V.List_ident, seq(terminal("."), seq(terminal("("), seq(V.Predicate, seq(terminal("|"), seq(V.Expression, terminal(")"))))))))
G.Couple = alt(seq(V.Expression, seq(terminal("|->"), V.Expression)), seq(V.Expression, V.Expression))
G.Empty_set = terminal("{}")
G.Integer_set = alt(terminal("INTEGER") , terminal("NATURAL"), terminal("NATURAL1"), terminal("NAT"), terminal("NAT1"), terminal("INT"))
G.Boolean_set = terminal("BOOL")
G.String_set = terminal("STRING")
G.Comprehension_set = seq(terminal("{"), seq(oneOrMoreSep(V.Ident, ","), seq(terminal("|"), seq(V.Predicate, terminal("}")))))
G.Subsets = alt(seq(terminal("POW"), seq(terminal("("), seq(V.Expression, terminal(")")))), seq(terminal("POW1"), seq(terminal("("), seq(V.Expression, terminal(")")))))
G.Finite_subsets = alt(seq(terminal("FIN"), seq(terminal("("), seq(V.Expression, terminal(")")))), seq(terminal("FIN1"), seq(terminal("("), seq(V.Expression, terminal(")")))))
G.Set_extension = seq(terminal("{"), seq(oneOrMoreSep(V.Expression, ","), terminal("}")))
G.Interval = seq(V.Expression, seq(terminal(".."), V.Expression))
G.Union = seq(V.Expression, seq(terminal("\\/"), V.Expression))
G.Intersection = seq(V.Expression, seq(terminal("/\\"), V.Expression))
G.Generalized_union = seq(terminal("union"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Generalized_intersection = seq(terminal("inter"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Quantified_union = seq(terminal("\\/"), seq(V.List_ident, seq(terminal("."), seq(terminal("("), seq(V.Predicate, seq(terminal("|"), seq(V.Expression, terminal(")"))))))))
G.Quantified_intersection = seq(terminal("/\\"), seq(V.List_ident, seq(terminal("."), seq(terminal("("), seq(V.Predicate, seq(terminal("|"), seq(V.Expression, terminal(")"))))))))
G.Relations = seq(V.Expression, seq(terminal("<->"), V.Expression))
G.Identify = seq(terminal("id"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Reverse = seq(V.Expression, terminal("~"))
G.First_projection = seq(terminal("prj1"), seq(terminal("("), seq(V.Expression, seq(terminal(","), seq(V.Expression, terminal(")"))))))
G.Second_projection = seq(terminal("prj2"), seq(terminal("("), seq(V.Expression, seq(terminal(","), seq(V.Expression, terminal(")"))))))
G.Composition = seq(V.Expression, seq(terminal(";"), V.Expression))
G.Direct_product = seq(V.Expression, seq(terminal("><"), V.Expression))
G.Parallel_product = seq(V.Expression, seq(terminal("||"), V.Expression))
G.Iteration = seq(terminal("iterate"), seq(terminal("("), seq(V.Expression, seq(terminal(","), seq(V.Expression, terminal(")"))))))
G.Reflexive_closure = seq(terminal("closure"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Closure = seq(terminal("closure1"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Domain = seq(terminal("dom"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Range = seq(terminal("ran"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Image = seq(V.Expression, seq(terminal("["), seq(V.Expression, terminal("]"))))
G.Domain_restriction = seq(V.Expression, seq(terminal("<|"), V.Expression))
G.Domain_subtraction = seq(V.Expression, seq(terminal("<<|"), V.Expression))
G.Range_restriction = seq(V.Expression, seq(terminal("|>"), V.Expression))
G.Range_subtraction = seq(V.Expression, seq(terminal("|>>"), V.Expression))
G.Overwrite = seq(V.Expression, seq(terminal("<+"), V.Expression))
G.Partial_functions = seq(V.Expression, seq(terminal("+->"), V.Expression))
G.Total_functions = seq(V.Expression, seq(terminal("-->"), V.Expression))
G.Partial_injections = seq(V.Expression, seq(terminal(">+>"), V.Expression))
G.Total_injections = seq(V.Expression, seq(terminal(">->"), V.Expression))
G.Partial_surjections = seq(V.Expression, seq(terminal("+->>"), V.Expression))
G.Total_surjections = seq(V.Expression, seq(terminal("-->>"), V.Expression))
G.Total_bijections = seq(V.Expression, seq(terminal(">->>"), V.Expression))
G.Lambada_expression = seq(terminal("%"), seq(V.List_ident, seq(terminal("."), seq(terminal("("), seq(V.Predicate, seq(terminal("|"), seq(V.Expression, terminal(")"))))))))
G.Evaluation_functions = seq(V.Expression, seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Transformed_function = seq(terminal("fnc"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Transformed_relation = seq(terminal("rel"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Sequences = seq(terminal("seq"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Non_empty_sequences = seq(terminal("seq1"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Injective_sequences = seq(terminal("iseq"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Non_empty_inj_sequences = seq(terminal("iseq1"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Permutations = seq(terminal("perm"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Empty_sequence = seq(terminal("["), terminal("]"))
G.Sequence_extension = seq(terminal("["), seq(oneOrMoreSep(V.Expression, ","), terminal("]")))
G.Sequence_size = seq(terminal("size"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Sequence_first_element = seq(terminal("first"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Sequence_last_element = seq(terminal("last"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Sequence_front = seq(terminal("front"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Sequence_tail = seq(terminal("tail"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Reverse_sequence = seq(terminal("rev"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Concatenation = seq(V.Expression, seq(terminal("^"), V.Expression))
G.Insert_front = seq(V.Expression, seq(terminal("->"), V.Expression))
G.Insert_tail = seq(V.Expression, seq(terminal("<-"), V.Expression))
G.Restrict_front = seq(V.Expression, seq(terminal("/|\\"), V.Expression))
G.Restrict_tail = seq(V.Expression, seq(terminal("\\|/"), V.Expression))
G.Generalized_concat = seq(terminal("conc"), seq(terminal("("), seq(V.Expression, terminal(")"))))
G.Substitution = alt(V.Level1_substitution , V.Simultaneous_substitution, V.Sequence_substitution)
G.Level1_substitution = alt(V.Block_substitution , V.Identity_substitution, V.Becomes_equal_substitution, V.Precondition_substitution, V.Assertion_substitution, V.Choice_limited_substitution, V.If_substitution, V.Select_substitution, V.Case_substitution, V.Any_substitution, V.Let_substitution, V.Becomes_elt_substitution, V.Become_such_that_substitution, V.Var_substitution, V.Call_up_substitution, V.While_substitution)
G.Block_substitution = seq(terminal("BEGIN"), seq(V.Substitution, terminal("END")))
G.Identity_substitution = terminal("skip")
G.Becomes_equal_substitution = alt(seq(oneOrMoreSep(oneOrMoreSep(V.Ident, "."), ","), seq(terminal(":="), oneOrMoreSep(V.Expression, ","))), seq(oneOrMoreSep(V.Ident, "."), seq(terminal("("), seq(oneOrMoreSep(V.Expression, ","), seq(terminal(")"), seq(terminal(":="), V.Expression))))))
G.Precondition_substitution = seq(terminal("PRE"), seq(V.Predicate, seq(terminal("THEN"), seq(V.Substitution, terminal("END")))))
G.Assertion_substitution = seq(terminal("ASSERT"), seq(V.Predicate, seq(terminal("THEN"), seq(V.Substitution, terminal("END")))))
G.Choice_limited_substitution = seq(terminal("CHOICE"), seq(V.Substitution, seq(V.Choice_limited_substitutionVRZ, terminal("END"))))
G.Choice_limited_substitutionVRZ = alt(empty(), seq(seq(terminal("OR"), V.Substitution), V.Choice_limited_substitutionVRZ))
G.If_substitution = seq(terminal("IF"), seq(V.Predicate, seq(terminal("THEN"), seq(V.Substitution, seq(V.If_substitutionVRZ, seq(optional(seq(terminal("ELSE"), V.Substitution)), terminal("END")))))))
G.If_substitutionVRZ = alt(empty(), seq(seq(terminal("ELSIF"), seq(V.Predicate, seq(terminal("THEN"), V.Substitution))), V.If_substitutionVRZ))
G.Select_substitution = seq(terminal("SELECT"), seq(V.Predicate, seq(terminal("THEN"), seq(V.Substitution, seq(V.Select_substitutionVRZ, seq(optional(seq(terminal("ELSE"), V.Substitution)), terminal("END")))))))
G.Select_substitutionVRZ = alt(empty(), seq(seq(terminal("WHEN"), seq(V.Predicate, seq(terminal("THEN"), V.Substitution))), V.Select_substitutionVRZ))
G.Case_substitution = seq(terminal("CASE"), seq(V.Expression, seq(terminal("OF"), seq(terminal("EITHER"), seq(oneOrMoreSep(V.Simple_term, ","), seq(terminal("THEN"), seq(V.Substitution, seq(V.Case_substitutionVRZ, seq(optional(seq(terminal("ELSE"), V.Substitution)), seq(terminal("END"), terminal("END")))))))))))
G.Case_substitutionVRZ = alt(empty(), seq(seq(terminal("OR"), seq(oneOrMoreSep(V.Simple_term, ","), seq(terminal("THEN"), V.Substitution))), V.Case_substitutionVRZ))
G.Any_substitution = seq(terminal("ANY"), seq(oneOrMoreSep(V.Ident, ","), seq(terminal("WHERE"), seq(V.Predicate, seq(terminal("THEN"), seq(V.Substitution, terminal("END")))))))
G.Let_substitution = seq(terminal("LET"), seq(oneOrMoreSep(V.Ident, ","), seq(terminal("BE"), seq(oneOrMoreSep(seq(V.Ident, seq(terminal("="), V.Expression)), "&"), seq(terminal("IN"), seq(V.Substitution, terminal("END")))))))
G.Becomes_elt_substitution = seq(oneOrMoreSep(oneOrMoreSep(V.Ident, "."), ","), seq(terminal("::"), V.Expression))
G.Become_such_that_substitution = seq(oneOrMoreSep(oneOrMoreSep(V.Ident, "."), ","), seq(terminal(":"), seq(terminal("("), seq(V.Predicate, terminal(")")))))
G.Var_substitution = seq(terminal("VAR"), seq(oneOrMoreSep(V.Ident, ","), seq(terminal("IN"), seq(V.Substitution, terminal("END")))))
G.Call_up_substitution = seq(optional(seq(oneOrMoreSep(oneOrMoreSep(V.Ident, "."), ","), terminal("<-"))), seq(oneOrMoreSep(V.Ident, "."), optional(seq(terminal("("), seq(oneOrMoreSep(V.Expression, ","), terminal(")"))))))
G.While_substitution = seq(terminal("WHILE"), seq(V.Condition, seq(terminal("DO"), seq(V.Instruction, seq(terminal("INVARIANT"), seq(V.Predicate, seq(terminal("VARIANT"), seq(V.Expression, terminal("END")))))))))
G.Simultaneous_substitution = seq(V.Substitution, seq(terminal("||"), V.Substitution))
G.Sequence_substitution = seq(V.Substitution, seq(terminal(";"), V.Substitution))
G.List_ident = alt(V.Ident, seq(terminal("("), seq(oneOrMoreSep(V.Ident, ","), terminal(")"))))
G.Data = alt(oneOrMoreSep(V.Ident, "."), seq(oneOrMoreSep(V.Ident, "."), terminal("$0")))
G.Expr_bracketed = seq(terminal("("), seq(V.Expression, terminal(")")))
G.String_lit = V.Character_string
G.Ident = terminal("ID")
G.Integer_literal = terminal("INTLit")
G.Character_string = terminal("CString")

Lua Language

  • lua_grammar
G.startSymbol = "chunk"

G.chunk = seq(V.chunkVRZ, optional(seq(V.laststat, optional(terminal(";")))))
G.chunkVRZ = alt(empty(), seq(seq(V.stat, optional(terminal(";"))), V.chunkVRZ))
G.block = V.chunk
G.stat = alt(seq(V.varlist, seq(terminal("="), V.explist)) , 
             V.functioncall, 
             seq(terminal("do"), seq(V.block, terminal("end"))),
             seq(terminal("while"), seq(V.exp, seq(terminal("do"), seq(V.block, terminal("end"))))),
             seq(terminal("repeat"), seq(V.block, seq(terminal("until"), V.exp))),
             seq(terminal("if"), seq(V.exp, seq(terminal("then"), seq(V.block, seq(V.statVRZ, seq(optional(seq(terminal("else"), V.block)), terminal("end"))))))),
             seq(terminal("for"), seq(V.Name, seq(terminal("="), seq(V.exp, seq(terminal(","), seq(V.exp, seq(optional(seq(terminal(","), V.exp)), seq(terminal("do"), seq(V.block, terminal("end")))))))))),
             seq(terminal("for"), seq(V.namelist, seq(terminal("in"), seq(V.explist, seq(terminal("do"), seq(V.block, terminal("end"))))))),
             seq(terminal("function"), seq(V.funcname, V.funcbody)),
             seq(terminal("local"), seq(terminal("function"), seq(V.Name, V.funcbody))),
             seq(terminal("local"), seq(V.namelist, optional(seq(terminal("="), V.explist))))
             )
G.statVRZ = alt(empty(), seq(seq(terminal("elseif"), seq(V.exp, seq(terminal("then"), V.block))), V.statVRZ))
G.laststat = alt(seq(terminal("return"), optional(V.explist)), terminal("break"))
G.funcname = seq(oneOrMoreSep(V.Name, "."), optional(seq(terminal(":"), V.Name)))
G.varlist = oneOrMoreSep(V.var, ",")
G.var = alt(V.Name , seq(V.prefixexp, seq(terminal("["), seq(V.exp, terminal("]")))), seq(V.prefixexp, seq(terminal("."), V.Name)))
G.namelist = oneOrMoreSep(V.Name, ",")
G.explist = oneOrMoreSep(V.exp, ",")
G.exp = alt(terminal("nil") , terminal("false"), terminal("true"), V.Number, V.String, terminal("..."), V.Function, V.prefixexp, V.tableconstructor, seq(V.exp, seq(V.binop, V.exp)), seq(V.unop, V.exp))
G.prefixexp = alt(V.var , V.functioncall, seq(terminal("("), seq(V.exp, terminal(")"))))
G.functioncall = alt(seq(V.prefixexp, V.args), seq(V.prefixexp, seq(terminal(":"), seq(V.Name, V.args))))
G.args = alt(seq(terminal("("), seq(optional(V.explist), terminal(")"))) , V.tableconstructor, V.String)
G.Function = seq(terminal("function"), V.funcbody)
G.funcbody = seq(terminal("("), seq(optional(V.parlist), seq(terminal(")"), seq(V.block, terminal("end")))))
G.parlist = alt(seq(V.namelist, optional(seq(terminal(","), terminal("...")))), terminal("..."))
G.tableconstructor = seq(terminal("{"), seq(optional(V.fieldlist), terminal("}")))
G.fieldlist = seq(V.field, seq(V.fieldlistVRZ, optional(V.fieldsep)))
G.fieldlistVRZ = alt(empty(), seq(seq(V.fieldsep, V.field), V.fieldlistVRZ))
G.field = alt(seq(terminal("["), seq(V.exp, seq(terminal("]"), seq(terminal("="), V.exp)))) , seq(V.Name, seq(terminal("="), V.exp)), V.exp)
G.fieldsep = alt(terminal(","), terminal(";"))
G.binop = alt(terminal("+") , terminal("-"), terminal("*"), terminal("/"), terminal("^"), terminal("%"), terminal(".."), terminal("<"), terminal("<="), terminal(">"), terminal(">="), terminal("=="), terminal("~="), terminal("and"), terminal("or"))
G.unop = alt(terminal("-") , terminal("not"), terminal("#"))
G.LetAZ = V.AlfAF
G.Letaz = V.Alfaf
G.Letter = alt(V.LetAZ, V.Letaz)
G.Name = seq(V.Letter, V.NameVRZ)
G.NameVRZ = alt(empty(), seq(alt(V.Letter , terminal("_"), V.Num09), V.NameVRZ))
G.DecimalIntegerLiteral = seq(V.Num19, V.DecimalIntegerLiteralVRZ)
G.DecimalIntegerLiteralVRZ = alt(empty(), seq(V.Num09, V.DecimalIntegerLiteralVRZ))
G.HexIntegerLiteral = seq(terminal("0x"), oneOrMore(alt(V.Num09 , V.Alfaf, V.AlfAF)))
G.DoubleLiteral = seq(oneOrMore(V.Num09), seq(terminal("."), seq(V.DoubleLiteralVRZ, optional(seq(alt(terminal("e"), terminal("E")), seq(optional(alt(terminal("+"), terminal("-"))), oneOrMore(V.Num09)))))))
G.DoubleLiteralVRZ = alt(empty(), seq(V.Num09, V.DoubleLiteralVRZ))
G.Number = alt(V.DecimalIntegerLiteral , V.HexIntegerLiteral, V.DoubleLiteral)
G.Num19 = alt(terminal("1") , terminal("2"), terminal("3"), terminal("4"), terminal("5"), terminal("6"), terminal("7"), terminal("8"), terminal("9"))
G.Num09 = alt(terminal("0"), V.Num19)
G.Alfaf = alt(terminal("a") , terminal("b"), terminal("c"), terminal("d"), terminal("e"), terminal("f"))
G.AlfAF = alt(terminal("A") , terminal("B"), terminal("C"), terminal("D"), terminal("E"), terminal("F"))
G.String = alt(empty(), seq(alt(V.Letter, V.Num09), V.String))
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License