Esempio n. 1
0
def asp_grammar_comments():
    # return [ap.RegExMatch(r'%\*.*?\*%'), ap.RegExMatch(r'%.*$')]  # TODO: handle multiline comments
    # wait for Arpeggio's PR#38, which fix the problem
    # return [ap.RegExMatch(r'%\*.*?\*%', multiline=True), ap.RegExMatch(r'%.*$')]
    # Follows a non-efficient but working way to do multiline
    return [
        ap.RegExMatch(r'%\*((([^\*]?%)|([^%]?\*))|([^\*%]))*\*%'),
        ap.RegExMatch(r'%.*$')
    ]
Esempio n. 2
0
def ordinaux():
    return peg.RegExMatch(r"(?:\de|10e|1ère|\
    première|deuxième|troisième|quatrième|cinquième|sixième|septième|huitième|neuvième|dixième)"
                          )
Esempio n. 3
0
def num_column():
    return peg.RegExMatch(r"(?:\d|10|dix|\
    un|une|deux|trois|quatre|cinq|six|sept|huit|neuf|troie|de)")
Esempio n. 4
0
 def variable():
     return ap.RegExMatch(r'(([A-Z][a-zA-Z0-9_]*)|(_))')
Esempio n. 5
0
 def newline():
     return arpeggio.RegExMatch(r"\n")
Esempio n. 6
0
 def allowed_chars():
     return arpeggio.RegExMatch(
         r'[\w\^°!§$%&/\(\)\[\]{}\~@\+\-\*\?\>\<\._:`\\€]+')
Esempio n. 7
0
 def text():
     return '"', ap.RegExMatch(r'((\\")|([^"]))*'), '"'
Esempio n. 8
0
 def ident():
     return ap.RegExMatch(r'[a-z_-][a-zA-Z0-9_]*')
Esempio n. 9
0
def IDENT():
    return [STANDARD_IDENT, arpeggio.RegExMatch(r"\$\w*")]
Esempio n. 10
0
 def text():
     return ap.ZeroOrMore([r'\"', ap.RegExMatch(r'[^"]*')])
Esempio n. 11
0
 def variable():   return ap.RegExMatch(r'(([A-Z][a-zA-Z0-9_]*)|(_))')
 def subterm():    return [(ident, ap.Optional("(", args, ")")), litteral, variable]
Esempio n. 12
0
 def text():       return '"', ap.RegExMatch(r'((\\")|([^"]))*'), '"'
 def litteral():   return [ident, text, number]
Esempio n. 13
0
 def number():     return ap.RegExMatch(r'-?[0-9]+')
 def text():       return '"', ap.RegExMatch(r'((\\")|([^"]))*'), '"'
Esempio n. 14
0
 def ident():      return ap.RegExMatch(r'[a-z][a-zA-Z0-9_]*')
 def number():     return ap.RegExMatch(r'-?[0-9]+')
Esempio n. 15
0
 def arityterm():
     return ident, '/', ap.RegExMatch(r'[0-9]+')
Esempio n. 16
0
def verb():
    return peg.RegExMatch(
        r"(?:(?:(?:décal|pos|termin|plac|sélectionn)(?:er|ez|é|e))|(?:choisi(?:s|r|e|ssez))|(?:met(?:s|ttez|tre)))(?:(?: |-)(?:la|le)| une| un)"
    )
Esempio n. 17
0
def turn():
    return peg.RegExMatch(r"(?:(?:(tourn)(?:er|ez|é|e))(?:(?: |-)(?:la|le))?)")
Esempio n. 18
0
 def text():         return ap.Sequence('"', ap.RegExMatch(r'((\\")|([^"]))*'), '"', skipws=False)
 def comment():      return ap.RegExMatch(r'%.*$'),
Esempio n. 19
0
 def number():
     return ap.RegExMatch(r'-?[0-9]+')
Esempio n. 20
0
 def comment():      return ap.RegExMatch(r'%.*$'),
 def multiline_comment(): return ap.RegExMatch(r'%\*.*?\*%', multiline=True),
Esempio n. 21
0
 def single_quoted_string():
     return arpeggio.RegExMatch(r'''(?s)('[^'\\]*(?:\\.[^'\\]*)*')''')
Esempio n. 22
0
 def multiline_comment(): return ap.RegExMatch(r'%\*.*?\*%', multiline=True),
 def asp_code():     return ap.RegExMatch(r'[^%"\.]*[^%"\.\s]', multiline=True),
Esempio n. 23
0
 def comment_shell():
     return arpeggio.RegExMatch(r"#.*")
Esempio n. 24
0
 def asp_code():     return ap.RegExMatch(r'[^%"\.]*[^%"\.\s]', multiline=True),
 def rule_end():     return '.',
Esempio n. 25
0
 def double_quoted_string():
     return arpeggio.RegExMatch(r'''("[^"\\]*(?:\\.[^"\\]*)*")''')
Esempio n. 26
0
def valid():
    return peg.RegExMatch(r"(?:valid(?:ez|é|er|e)|en bas)")