:copyright: Copyright 2006-2024 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details. """
from pygments.lexer import RegexLexer, bygroups, include, combined, default, \
words from pygments.token import Text, Comment, Operator, Keyword, Punctuation, \
Name, String, Number
__all__ = ['QVToLexer']
class QVToLexer(RegexLexer): """ For the QVT Operational Mapping language.
Reference for implementing this: «Meta Object Facility (MOF) 2.0
Query/View/Transformation Specification», Version 1.1 - January 2011
(https://www.omg.org/spec/QVT/1.1/), see §8.4, «Concrete Syntax» in
particular.
Notable tokens assignments:
- Name.Classis 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'. """ # With obvious borrowings & inspiration from the Java, Python and C lexers
# There is no need to distinguish between String.Single and # String.Double: 'strings' is factorised for 'dqs' and 'sqs' 'strings': [
(r'[^\\\'"\n]+', String), # quotes, percents and backslashes must be parsed one at a time
(r'[\'"\\]', String),
], 'stringescape': [
(r'\\([\\btnfr"\']|u[0-3][0-7]{2}|u[0-7]{1,2})', String.Escape)
], 'dqs': [ # double-quoted string
(r'"', String, '#pop'),
(r'\\\\|\\"', String.Escape),
include('strings')
], 'sqs': [ # single-quoted string
(r"'", String, '#pop'),
(r"\\\\|\\'", String.Escape),
include('strings')
], 'name': [
(r'[a-zA-Z_]\w*', Name),
], # numbers: excerpt taken from the python lexer 'numbers': [
(r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
(r'\d+[eE][+-]?[0-9]+', Number.Float),
(r'\d+', Number.Integer)
],
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.