Access Keys:
Skip to content (Access Key - 0)


1 Application Scenario DSL grammar

Print this page

Application Scenario DSL grammar

Below is a formal grammar reference for the Application Scenario DSL, generated as modified Extended Backus-Naur Form (EBNF) in ANother Tool for Language Recognition (ANTLR) notation.

scenario              :    'scenario' ID '{' scenario_body '}'
                           -> ^(ID {commentsBefore($start)} scenario_body)
                      ;

scenario_body         :    service_id
                           service_prio
                           scenario_component+
                           channel*
                           -> ^(BODY service_id service_prio ^(COMPONENTS scenario_component+) ^(CHANNELS channel*));

service_prio          :    'service-priority' QUOTED ';'
                           -> ^(QUOTED);
service_id            :    'service-name' QUOTED ';' 'service-vendor' QUOTED ';' 'service-version' QUOTED ';'
                           -> ^(SERVICE_ID QUOTED QUOTED QUOTED);
sbb_id                :    'sbb-name' QUOTED ';' 'sbb-vendor' QUOTED ';' 'sbb-version' QUOTED ';'
                           -> ^(SBB_ID QUOTED QUOTED QUOTED);

scenario_component    :    interface_comp
                      |    udl
                      |    timer
                      |    fsm
                      |    predefined_sbb ;

predefined_sbb        :    'predefined-sbb' ID '{' predefined_sbb_body '}'
                            -> ^('predefined-sbb' {commentsBefore($start)} ID predefined_sbb_body);
predefined_sbb_body   :   slee_id_ref
                           -> ^(BODY slee_id_ref);

interface_comp        :    'interface' ID '{' interface_body '}'
                           -> ^('interface' {commentsBefore($start)} ID interface_body);
interface_body        :    interface_definition_id_ref
                           -> ^(BODY interface_definition_id_ref);

slee_id_ref           :    'reference-name' QUOTED ';' 'reference-vendor' QUOTED ';' 'reference-version' QUOTED ';'
                           -> ^(SLEE_ID_REF QUOTED QUOTED QUOTED);

interface_definition_id_ref  :    'context-name' QUOTED ';' 'context-vendor' QUOTED ';' 'context-version' QUOTED ';' 'context-fsm-name' QUOTED ';'
                           -> ^(INTERFACEDEFINITION_ID_REF QUOTED QUOTED QUOTED QUOTED);

udl                   :    'udl' ID '{' udl_body '}'
                            -> ^('udl' {commentsBefore($start)} ID udl_body);
udl_body              :    udl_config;
udl_config            :    (udl_profile_ref); // udl_profile_def | lookup_service_ref | db_ra_ref);
udl_profile_ref       :    'profile-reference' '{' udl_profile_ref_body '}'
                           -> ^('profile-reference' udl_profile_ref_body);
udl_profile_ref_body  :    slee_id_ref;


timer                 :    'timer' ID '{' timer_body '}'
                           -> ^('timer' {commentsBefore($start)} ID timer_body);
timer_body            :    'timeout' POS_INT ';' 'preserve-missed' preserve_missed ';' timer_config
                           -> ^(BODY POS_INT preserve_missed timer_config);
preserve_missed       :    ('ALL'|'LAST'|'NONE');
timer_config          :    timer_periodic | timer_non_periodic;
timer_periodic        :    'periodic'! '{'! periodic_config_body '}'!;
timer_non_periodic    :    'non-periodic'! '{'! non_periodic_config_body '}'!;
periodic_config_body  :    'start-offset' POS_INT ';' 'period' POS_INT ';' 'repetitions' POS_INT ';'
                           -> ^('periodic' POS_INT POS_INT POS_INT);
non_periodic_config_body  :    'expiry-offset' POS_INT ';'
                           -> ^('non-periodic' POS_INT);

fsm                   :    fsm_type? 'fsm' ID '{' fsm_body '}'
                           -> ^(ID {commentsBefore($start)} ^(FSM_TYPE fsm_type?) fsm_body);
fsm_type              :    ('root');
fsm_body              :    'initial-event-select' initial_event_select ';' 'dsl-file' QUOTED ';' 'action-impl-class' QUOTED ';' package_prefix? sbb_base_class? sbb_id (classcontainer_references)?
                           -> ^(BODY ^(IES initial_event_select) QUOTED QUOTED package_prefix? sbb_base_class? sbb_id (classcontainer_references)?);
package_prefix        :    'package-prefix' QUOTED ';'
                           -> ^('package-prefix' QUOTED);
sbb_base_class        :    'sbb-base-class' QUOTED ';'
                           -> ^('sbb-base-class' QUOTED);
classcontainer_references : 'container-references' '{' container_reference* '}'
                           -> ^('container-references' container_reference*);
container_reference   :    library_reference |
                           eventtype_reference |
                           ratype_reference |
                           ra_reference |
                           profilespec_reference |
                           sbb_reference |
                           subjar_reference |
                           project_resource_java_reference |
                           project_resource_jar_reference ;
ratype_reference      :    'ratype-reference' '{' slee_id_ref '}'
                           -> ^('ratype-reference' slee_id_ref);
eventtype_reference   :    'eventtype-reference' '{' slee_id_ref '}'
                           -> ^('eventtype-reference' slee_id_ref);
ra_reference          :    'ra-reference' '{' slee_id_ref '}'
                           -> ^('ra-reference' slee_id_ref);
profilespec_reference :    'profilespec-reference' '{' slee_id_ref '}'
                           -> ^('profilespec-reference' slee_id_ref);
sbb_reference         :    'sbb-reference' '{' slee_id_ref '}'
                           -> ^('sbb-reference' slee_id_ref);
library_reference     :    'library-reference' '{' slee_id_ref '}'
                           -> ^('library-reference' slee_id_ref);
subjar_reference      :    'subjar-reference' '{' slee_id_ref 'subjar-name' QUOTED ';' '}'
                           -> ^('subjar-reference' slee_id_ref QUOTED);
project_resource_java_reference : 'project-java-resource' QUOTED ';'
                           -> ^('project-java-resource' QUOTED);
project_resource_jar_reference  : 'project-jar-resource' QUOTED ';'
                           -> ^('project-jar-resource' QUOTED);

initial_event_select  :    ('ACTIVITY_CONTEXT'|'ADDRESS'|'ADDRESS_PROFILE'|'EVENT'|'EVENT_TYPE'|'METHOD');


channel               :    'channel' channel_end 'to' channel_end ';'
                           -> ^('channel' {commentsBefore($start)} channel_end channel_end);
channel_end           :    ID '.' ID
                           -> ^(CHANNEL_END ID ID);

POS_INT               :    '1'..'9' ('0'..'9')*;
INT                   :    ('-')? '0'..'9'+;
VERSION               :    '0'..'9' '.' '0'..'9' ('.' '0'..'9')*;

WS                    :    (' '|'\r'|'\t'|'\n')+ {skip();};

ID                    :    ('a'..'z'|'A'..'Z'|'0'..'9'|'_')+;


QUOTED                :   '"' .* '"'
                           {setText(getText().substring(1,getText().length()-1));}
                      ;

COMMENT
    :    '/*' .* '*/' {$channel=HIDDEN;}
    ;
List of keywords:
scenario, service-priority, service-name, service-vendor, service-version, sbb-name, sbb-vendor, sbb-version, predefined-sbb, category, interface, reference-name, reference-vendor, reference-version, udl, profile-reference, timer, timeout, preserve-missed, periodic, non-periodic, start-offset, period, repetitions, expiry-offset, root, fsm, initial-event-select, channel
Adaptavist Theme Builder Powered by Atlassian Confluence