QVT 1.0 NO IDEA Avatar
  1. OMG Issue

QVT — The BNF syntax of QVTOperational is not complete

  • Key: QVT-9
  • Legacy Issue Number: 10923
  • Status: closed  
  • Source: France Telecom R&D ( Mariano Belaunde)
  • Summary:

    The BNF syntax of QVTOperational is not complete. Various elements are missing in the QVTOperational BNF like the 'late' keyword and the notation for enumeration and datatypes.

  • Reported: QVT 1.0b1 — Tue, 17 Apr 2007 04:00 GMT
  • Disposition: Resolved — QVT 1.0
  • Disposition Summary:

    The grammar was out of sync in respect with the metamodel. The issue is resolved globally by providing by new version of the grammar. The following text should replace the actual content of section 8.4.6.1.

    // keywords

    Bag, Collection, Dict, OrderedSet, Sequence, Set, Tuple, abstract,
    access, and, any, assert, blackbox, break, class, collect,
    collectNested, collectOne, collectselect, collectselectOne,
    composes, compute, configuration, constructor, continue, datatype,
    default, derived, disjuncts, do, elif, else, end, endif, enforcing,
    enum, except, exists, extends, extends, false, forAll, forEach ,
    forOne, from, helper, if, implies, import , in, inherits, init,
    inout, intermediate, invresolve, invresolveIn, invresolveone,
    invresolveoneIn , isUnique, iterate, late, let, library, literal,
    log, main, map, mapping, merges, metamodel, modeltype, new, not,
    null, object, one, or, out, package, population, primitive, property,
    query, raise, refines, refines, reject, resolve, resolveIn, resolveone,
    resolveoneIn, return, select, selectOne, sortedBy, static, static,
    switch, tag, then, transformation, true, try, typedef, unlimited,
    uses, when, where, while, with, xcollect , xmap, xor, xselect

    // start rule
    <topLevel> ::= <import>* <unit_definition>*

    <import> ::= 'from' <unit> 'import' (<identifier_list> | '*') ';'

    'import' <unit> ';'
    <unit> ::= <identifier> ('.' <identifier>)*

    <identifier_list> ::= <identifier> (',' <identifier>)*

    // definitions in a compilation unit
    <unit_definition>
    ::= <transformation>

    <library>
    <access_usage> ';'
    <modeltype>
    <metamodel>
    <class>
    <property>
    <helper>
    <constructor>
    <entry>
    <mapping>
    <tag>
    <typedef>

    // Transformation and library definitions

    <transformation> ::= <transformation_h> (";" | '

    {' <module_definition>* '}' ';'?)
    <library> ::= <library_h> (";" | '{' <module_definition>* '}

    ' ';')

    // Transformation header
    <transformation_h> ::= <qualifier>* 'transformation' <identifier>
    <transformation_signature> <transformation_usage_refine>?
    <transformation_usage_refine> ::= <module_usage> | <transformation_refine>
    <transformation_signature> ::= <simple_signature>
    <transformation_refine> ::= 'refines' <moduleref> 'enforcing' <identifier>

    // Library header
    <library_h> ::= 'library' <identifier> <library_signature>? <module_usage>?
    <library_signature> ::= <simple_signature>

    // import of transformation and library
    <module_usage> ::= <access_usage> | <extends_usage>
    <access_usage> ::= 'access' <module_kind>? <moduleref_list>
    <extends_usage> ::= 'extends' <module_kind>? <moduleref_list>
    <module_kind> ::= 'transformation' | 'library'
    <moduleref_list> ::= <moduleref> (',' <moduleref>)*
    <moduleref> ::= <scoped_identifier> <simple_signature>?

    // module definitions
    <module_definition>
    ::= <class>

    <property>
    <helper>
    <constructor>
    <entry>
    <mapping>
    <tag>
    <typedef>

    // general purpose grammar rules
    <qualifier> ::= 'blackbox' | 'abstract' | 'static'
    <complete_signature> ::= <simple_signature> (':' param_list)?
    <simple_signature> ::= '(' <param_list>? ')'
    <param_list> ::= <param> (',' <param>)*
    <param> ::= <param_direction>? <declarator>
    <param_direction> ::= 'in' | 'inout' | 'out'
    <simple_declarator> ::= <typespec>

    <scoped_identifier> ':' <typespec>
    <declarator> ::= <typespec> <init_part>?
    <scoped_identifier> ':' <typespec> <init_part>?
    <simple_declarator_list> ::= <simple_declarator> (',' <simple_declarator>)*
    <declarator_list> ::= <declarator> (',' <declarator>)*
    <declarator_semi_list> ::= <declarator> (';' <declarator>)*
    <init_part> ::= <init_op> <expression>
    <init_op> ::= '='
    ':=' '::='
    <typespec> ::= <type_reference> <extent_location>?
    <type_reference> ::= <scoped_identifier>
    <complex_type>
    <extent_location> ::= '@' <identifier>
    <complex_type> ::= <complex_type_key>
    <collection_key> '(' <typespec> ')'
    'Tuple' '(' <declarator_list> ')'
    'Dict' '(' <typespec> ',' <typespec> ')'
    <complex_type_key> ::= <collection_key>
    'Dict' 'Tuple'
    <collection_key> ::= 'Collection'
    'Set' 'OrderedSet' 'Sequence' 'Bag'
    'List'
    <scoped_identifier> ::= <identifier> ('::' <identifier>)*
    <scoped_identifier_list> ::= <scoped_identifier> (',' <scoped_identifier>)*
    <expression_list> ::= <expression_semi_list> ';'?
    <expression_semi_list> ::= <expression> (';' <expression>)*
    <expression_comma_list> ::= <expression> (',' <expression>)*
    <expression_block> ::= ' {' <expression_list>? '}

    '

    // model types compliance and metamodel declarations
    <modeltype> ::= 'modeltype' <identifier> <compliance_kind>?
    'uses' <packageref_list> <modeltype_where>? ';'
    <modeltype_where> ::= 'where' <expression_block>
    <packageref_list> ::= <packageref> (',' <packageref>)*
    <packageref> ::= (<scoped_identifier> ( '(' <uri> ')' )? | <uri>)
    <compliance_kind> ::= <STRING> // like: "strict" and "effective"
    <uri> ::= <STRING>

    // Syntax for defining explicitly metamodel contents
    <metamodel> ::= <metamodel_h> (";" | '

    {' <metamodel_def>* '}

    ' ';')
    <metamodel_h> ::= ('metamodel' | 'package') scoped_identifier
    <metamodel_def> ::= <class> | <enumeration> | <tag>

    <class> ::= <class_h> (";" | '

    {' <class_feature_list>? '}

    ' ';')
    <class_h> ::= <class_info> <scoped_identifier> <class_extension>?
    <class_info> ::= 'datatype'

    'primitive'
    'intermediate'? <qualifier>* 'class'
    <class_extension> ::= 'extends' <scoped_identifier_list>
    <class_feature_list> ::= <class_feature> (';' <class_feature>)*
    <class_feature> ::= <class_property>
    <class_operation> <tag>

    <class_property> ::= <feature_key>? <declarator> <multiplicity>?
    <opposite_property>?
    <feature_key> ::= 'composes' | 'derived' | 'static'
    <multiplicity> ::= '[' multiplicity_range ']'
    <multiplicity_range> ::= <INTEGER> | '*' | <INTEGER> '...' <INTEGER>
    <class_operation> ::= <feature_key>? <declarator> <complete_signature>

    <enumeration> ::= <enumeration_h> ';'

    <enumeration_h> ' {' <identifier_list> '}

    ' ';'?

    <enumeration_h> ::= 'enum' <identifier>
    <opposite_property> ::= 'opposites' <identifier>

    <tag> ::= 'tag' <tagid> <scoped_identifier> ('=' <tagvalue>)? ';'
    <tagid> ::= <STRING>
    <tagvalue> :: <expression>

    // typedefs
    <typedef> ::= 'typedef' <identifier> '=' <typespec> (typedef_condition)? ';'
    <typedef_condition> ::= '[' <expression> ']'

    // Properties in transformation
    <property> ::= 'intermediate'? <property_key>+ <declarator> ';'
    <property_key> ::= 'derived' | 'literal' | 'configuration' | 'property'

    // Syntax for helper operations
    <helper> ::= <helper_decl> | <helper_simple_def> | <helper_compound_def>
    <helper_header> ::= <helper_info> <scoped_identifier> <complete_signature>
    <helper_info> ::= <qualifier>* <helper_kind>
    <helper_kind> ::= 'helper' | 'query'
    <helper_decl> ::= <helper_header> ';'
    <helper_simple_def> ::= <helper_header> '=' <expression> ';'
    <helper_compound_def> ::= <helper_header> <expression_block> ';'?

    // Syntax for constructors
    <constructor> ::= <constructor_decl> | <constructor_def>
    <constructor_header> ::= <qualifier>* 'constructor' <scoped_identifier>
    <simple_signature>
    <constructor_decl> ::= <constructor_header> ';'
    <constructor_def> ::= <constructor_header> <expression_block> ';'?

    // Syntax for entries
    <entry> ::= <entry_decl> | <entry_def>
    <entry_header> :: 'main' <simple_signature>
    <entry_decl> ::= <entry_header> ';'
    <entry_def> ::= <entry_header> <expression_block> ';'?

    // syntax for mapping operations
    <mapping> ::= <mapping_decl> | <mapping_def>
    <mapping_decl> ::= <mapping_full_header> ';'
    <mapping_def> ::= <mapping_full_header> '

    {' <mapping_body> '}

    ' ';'?
    <mapping_full_header> ::= <mapping_header> <when>? <where>?
    <mapping_header> ::= <qualifier>* 'mapping' <param_direction>?
    <scoped_identifier> <complete_signature> <mapping_extra>*
    <mapping_extra> ::= <mapping_extension> | <mapping_refinement>
    <mapping_extension> ::= <mapping_extension_key> <scoped_identifier_list>
    <mapping_extension_key> ::= 'inherits' | 'merges' | 'disjuncts'
    <when> ::= 'when' <expression_block>
    <where> ::= 'where' <expression_block>
    <mapping_refinement> ::= 'refines' <scoped_identifier_list>
    <mapping_body> ::= <init_section>? <population_section>? <end_section>?
    <init_section> ::= 'init' <expression_block>
    <population_section> ::= <expression_list>

    'population' <expression_block>
    <end_section> ::= 'end' <expression_block>

    // Expressions

    <expression> ::= <assign_exp>

    <let_exp>
    <var_init_exp>

    <assign_exp> ::= <implies_exp>

    <unary_exp> <assign_op> <expression> <default_val>?
    <unary_exp> <assign_op> <expression_block> <default_val>?

    <assign_op> := ':=' | '::=' | '+=' | '-='

    <default_val> ::= 'default' <assign_exp>

    <implies_exp> ::= <or_exp>

    <implies_exp> 'implies' <or_exp>

    <or_exp> ::= <and_exp>

    <or_exp> <or_op> <and_exp>

    <or_op> ::= 'or' | 'xor'

    <and_exp> ::= <cmp_exp>

    <and_exp> 'and' <cmp_exp>

    <cmp_exp> ::= <additive_exp>

    <cmp_exp> <cmp_op> <additive_exp>

    <cmp_op> ::= '=' | '==' | '<>' | '<' | '>' | '<=' | '>='

    <additive_exp> ::= <mult_exp>

    <additive_exp> <add_op> <mult_exp>

    <add_op> ::= '+' | '-'

    <mult_exp> ::= <unary_exp>

    <mult_exp> <mult_op> <unary_exp>

    <mult_op> ::= '*' | '/' | '%'

    <unary_exp> ::= <postfix_exp>

    <unary_op> <unary_exp>

    <unary_op> ::= '-' | 'not' | '#' | '##' | '*'

    <postfix_exp> ::= <primary_exp>

    <postfix_exp> '(' <arg_list>? ')'
    <postfix_exp> '!'? '[' <declarator_vsep>? <expression> ']'
    <postfix_exp> <access_op>
    (<scoped_identifier>
    <iterator_exp> <block_exp>
    <control_exp> <rule_call_exp>)
    <postfix_exp> <resolve_exp>
    <postfix_exp> <resolve_in_exp>

    <declarator_vsep> ::= <simple_declarator> '|'
    <multi_declarator_vsep> ::= <simple_declarator_list> '|'

    <resolve_exp> ::= <resolve_key> '(' <resolve_condition>? ')'
    <resolve_condition> ::= <declarator> ('|' <expression>)?
    <resolve_op> ::= 'late'? <resolve_kind>
    <resolve_kind> ::= 'resolve' | 'resolveone' | 'invresolve' | 'invresolveone'

    <resolve_in_exp> ::= <resolve_in_key> '(' <scoped_identifier>
    (',' <resolve_condition>)?')'
    <resolve_in_op> ::= 'late'? <resolve_in_kind>
    <resolve_in_kind> ::= 'resolveIn' | 'resolveoneIn' | 'invresolveIn' | 'invresolveoneIn'

    <access_op> ::= '.' | '>' | '!>'

    <primary_exp> ::= <literal>

    <scoped_identifier>
    <if_exp>
    <block_exp>
    <control_exp>
    <rule_call_exp>
    <quit_exp>
    <try_exp>
    <raise_exp>
    <assert_exp>
    <log_exp>
    '(' <expression> ')'

    <literal> ::= <literal_simple>

    <literal_complex>

    <literal_simple> ::= <INTEGER> | <FLOAT> | <STRING>

    'true' 'false' 'unlimited' 'null'

    <literal_complex> ::= <literal_collection>

    <literal_tuple>
    <literal_dict>

    <literal_collection> ::= <collection_key> '

    {' <collection_item_list>? '}

    '

    <literal_tuple> ::= 'Tuple' '

    {' <tuple_item_list>? '}

    '

    <literal_dict> ::= 'Dict' '

    {' <dict_item_list>? '}

    '

    <collection_item_list> ::= <expression_comma_list>
    <tuple_item_list> ::= <declarator_list>
    <dict_item_list> ::= <dict_item> (',' <dict_item>)*
    <dict_item> ::= <literal_simple> '=' <expression>

    <if_exp> ::= 'if' <expression> <then_part>
    <elif_part>* <else_part>? 'endif'
    <then_part> ::= 'then' <if_body>
    <elif_part> ::= 'elif' <if_body>
    <else_part> ::= 'else' <if_body>
    <if_body> ::= <expression> | <expression_block>

    <iterator_exp> ::= <simple_iterator_op> '(' <declarator_vsep>? <expression> ')'

    <multi_iterator_op> '(' <multi_declarator_vsep>? <expression> ')'
    <iterate_exp>

    <simple_iterator_op> ::= 'reject' | 'select' | 'collect' | 'exists'

    'one' 'any' 'isUnique' 'collectNested'
    'sortedBy' 'xselect' 'xcollect'
    'selectOne' 'collectOne'
    'collectselect' 'collectselectOne'

    <multi_iterator_op> ::= 'forAll'

    <iterate_exp> ::= 'iterate' '(' <declarator_list> ';'
    <declarator> '|' <expression> ')'

    <iter_declarator> ::= <declarator>
    <iter_declarator_list> ::= <declarator_list>

    <block_exp> ::= (<object_exp> | <do_exp> | <switch_exp>)

    <object_exp> ::= 'object' ('(' <iter_declarator> ')')? <object_declarator>
    <expression_block>
    <object_declarator> ::= <typespec> | <identifier> ':' <typespec>?

    <do_exp> ::= 'do' <expression_block>

    <switch_exp> ::= 'switch' ('(' <iter_declarator> ')')? <switch_body>
    <switch_body> ::= '

    {' <switch_alt>+ <switch_else>? '}

    '
    <switch_alt> ::= '(' <expression> ')' '?' <expression> ';'
    <switch_else> ::= 'else' '?' <expression> ';'

    <control_exp> ::= (<while_exp> | <compute_exp> | <for_exp>)

    <while_exp> ::= 'while' '(' (<declarator> ';')? <expression> ')'
    <expression_block>
    <compute_exp> ::= 'compute' '(' <declarator> ')' <expression_block>
    <for_exp> ::= ('forEach' | 'forOne') '(' <iter_declarator_list>
    (';' <declarator>)? ('|' <expression>)? ')' <expression_block>

    <rule_call_exp> ::= ('map' | 'xmap' | 'new' )
    ('(' <declarator> ')')? <scoped_identifier>

    <let_exp> ::= 'let' <declarator_list> 'in' <expression>

    <var_init_exp> ::= 'var' <declarator>

    'var' '(' <declarator_list> ')'

    <quit_exp> ::= 'break' | 'continue' | <return_exp>)

    <return_exp> ::= 'return' ('(' <expression> ')')?

    <try_exp> ::= 'try' <expression_block> <except>+

    <except> ::= 'except' '(' <scoped_identifier_list> ')' <expression_block>

    <raise_exp> ::= 'raise' <scoped_identifier> ('(' <arg_list>? ')')?
    <arg_list> ::= <expression_comma_list>

    <assert_exp> ::= 'assert' <identifier>? '(' <expression> ')'
    ( 'with' <log_exp> )?

    <log_exp> ::= 'log' '(' <arg_list> ')' ('when' <expression>)?

  • Updated: Fri, 6 Mar 2015 20:54 GMT