3
V'íc¸ ã @ sf d Z ddlmZmZmZmZmZmZ ddlm Z m
Z
mZmZm
Z
mZmZmZ dgZG dd deZdS )zÎ
pygments.lexers.qvt
~~~~~~~~~~~~~~~~~~~
Lexer for QVT Operational language.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
é )Ú
RegexLexerÚbygroupsÚincludeÚcombinedÚdefaultÚwords)ÚTextÚCommentÚOperatorÚKeywordÚPunctuationÚNameÚStringÚNumberÚ QVToLexerc ^ @ sØ e Zd ZdZdZddgZdgZdefdefdee e e j
e fd e jfd
efdej
fdej
fd
efdefdefdejfdejjfdejfdejdfdeej
eejfdeej
eejfdejfdeejedfdeeedfdejfeddeedd fd!eedd"fed#ed$gd%efd&ejfed'gd(efd)eeejeed'fgd*ed'fed'gedddefgd
efdefgdejfgded'fdejfedgd!ed'fdejfedgdefgde j!fde j!fde j"fgdZ#dS )r u¿
For the `QVT Operational Mapping language <http://www.omg.org/spec/QVT/1.1/>`_.
Reference for implementing this: «Meta Object Facility (MOF) 2.0
Query/View/Transformation Specification», Version 1.1 - January 2011
(http://www.omg.org/spec/QVT/1.1/), see §8.4, «Concrete Syntax» in
particular.
Notable tokens assignments:
- Name.Class is assigned to the identifier following any of the following
keywords: metamodel, class, exception, primitive, enum, transformation
or library
- Name.Function is assigned to the names of mappings and queries
- Name.Builtin.Pseudo is assigned to the pre-defined variables 'this',
'self' and 'result'.
ZQVTOZqvtoZqvtz*.qvtoz\nz[^\S\n]+z(--|//)(\s*)(directive:)?(.*)$z/[*](.|\n)*?[*]/z\\\nz(and|not|or|xor|##?)\bz(:{1,2}=|[-+]=)\bz(@|<<|>>)\bz,!=|<>|==|=|!->|->|>=|<=|[.]{3}|[+/*%=<>&|.~]z[]{}:(),;[]z(true|false|unlimited|null)\bz(this|self|result)\bz(var)\bz(from|import)\bÚ
fromimportzK(metamodel|class|exception|primitive|enum|transformation|library)(\s+)(\w+)z(exception)(\s+)(\w+)z(main)\bz(mapping|helper|query)(\s+)Ú operationz(assert)(\s+)\bÚassertz:(Bag|Collection|Dict|OrderedSet|Sequence|Set|Tuple|List)\bÚkeywordsú"ÚstringescapeÚdqsú'ÚsqsÚnameÚnumbersz(?:[ \t]|\\\n)+z[a-zA-Z_][\w.]*z#popz::z (.*::)([a-zA-Z_]\w*)([ \t]*)(\()z(warning|error|fatal)\bÚabstractÚaccessÚanyÚblackboxÚbreakÚcaseÚcollectÚ
collectNestedÚ
collectOneÚ
collectselectÚcollectselectOneÚcomposesÚcomputeÚ
configurationÚconstructorÚcontinueÚdatatyper ÚderivedÚ disjunctsÚdoÚelifÚelseÚendÚendifÚexceptÚexistsÚextendsÚforAllÚforEachÚforOneÚfromÚifÚimpliesÚinÚinheritsÚinitÚinoutÚintermediateÚ
invresolveÚinvresolveInÚ
invresolveoneÚinvresolveoneInÚisUniqueÚiterateÚlateÚletÚliteralÚlogÚmapÚmergesÚ modeltypeÚnewÚobjectÚoneÚorderedÚoutÚpackageÚ
populationÚpropertyÚraiseÚreadonlyÚ
referencesÚrefinesÚrejectÚresolveÚ resolveInÚ
resolveoneÚresolveoneInÚreturnÚselectÚ selectOneÚsortedByÚstaticÚswitchÚtagÚthenÚtryÚtypedefÚ unlimitedÚusesÚwhenÚwhereÚwhileÚwithÚxcollectÚxmapÚxselectz\b)Úsuffixz[^\\\'"\n]+z[\'"\\]z+\\([\\btnfr"\']|u[0-3][0-7]{2}|u[0-7]{1,2})z\\\\|\\"Ústringsz\\\\|\\'z[a-zA-Z_]\w*z%(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?z\d+[eE][+-]?[0-9]+z\d+)Úrootr r r r rt r r r r r N)Yr r r r r r r! r"