grammatica-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Grammatica-users] multiline in token definition


From: Steffen Gaede
Subject: [Grammatica-users] multiline in token definition
Date: Thu, 03 Nov 2011 14:24:17 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1

I'm writing the grammar for an Select-from-where string.
The Main Problem is, that the regExp at defining token not known about
exclude words (like command words):

e.g.:
        FUNCTION_U =
<<(^((from|where|distinct|unique|or|and|not|group|order|by|having|as|asc|desc|on|like|between|in|count|min|max|avg|sum)[
]*\())[a-z0-9]+[ ]*\(>>
doesn't work: It accepts then only FUNCTION_U with suffix of excluded
text like "minxxxx", "havingbbb" not "murx".

Ok, then I decided to build a combination, that has all literal
combination. It functions, but this is confusing in a long line. Is
there the possibility to join it over multiple lines (like bash with "\")?

FUNCTION_U = <<(
(a([a-mo-rtuw-z0-9_][a-z0-9_]*|n([a-ce-z0-9_][a-z0-9_]*|d[a-z0-9_]+)?|s([abd-z0-9_]+|c[a-z0-9_]+))?)|
(b([a-df-xz0-9_][a-z0-9_]*|e([a-su-z0-9_][a-z0-9_]*|t([a-vx-z0-9_][a-z0-9_]*|w([a-df-z0-9_]+|e([a-df-z0-9_][a-z0-9_]*|e([a-mo-z0-9_][a-z0-9_]*|n[a-z0-9_]+)?)?)?)?)?|y[a-z0-9_]+)?)|
(c([a-np-z0-9_][a-z0-9_]*|o([a-tv-z0-9_][a-z0-9_]*|u([a-mo-z0-9_][a-z0-9_]*|n([a-su-z0-9_][a-z0-9_]*|t[a-z0-9_]+)?)?)?)?)|
(d([a-df-hj-z0-9_][a-z0-9_]*|[ei]([a-rt-z0-9_][a-z0-9_]*|s([abd-su-z0-9_][a-z0-9_]*|c[a-z0-9_]+|t([a-hj-z0-9_][a-z0-9_]*|i([a-mo-z0-9_][a-z0-9_]*|n([abd-z0-9_]+|c([a-su-z0-9_][a-z0-9_]*|t[a-z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a-qs-z0-9_][a-z0-9_]*|r[a-z0-9_]+)?)?)|u([a-su-z0-9_][a-z0-9_]*|t([a-df-z0-9_][a-z0-9_]*|e([a-qs-z0-9_][a-z0-9_]*|r[a-z0-9_]+)?)?)?)?)|
(r([a-hj-z0-9_][a-z0-9_]*|i([a-fh-z0-9_][a-z0-9_]*|g([a-gi-z0-9_][a-z0-9_]*|h([a-su-z0-9_][a-z0-9_]*|t[a-z0-9_]+)?)?)?)?)|
(s([a-df-tv-z0-9_][a-z0-9_]*|e([a-km-z0-9_][a-z0-9_]*|l([a-df-z0-9_][a-z0-9_]*|e([abd-z0-9_][a-z0-9_]*|c([a-su-z0-9_][a-z0-9_]*|t[a-z0-9_]+)?)?)?)?|u([a-ln-z0-9_][a-z0-9_]*|m[a-z0-9_]+)?)?)|
(u([a-mo-z0-9_][a-z0-9_]*|n([a-hj-z0-9_][a-z0-9_]*|i([a-pr-z0-9_][a-z0-9_]*|q([a-tv-z0-9_][a-z0-9_]*|u([a-df-z0-9_][a-z0-9_]*|e[a-z0-9_]+)?)?)?)?)?)|
(w([a-gi-z0-9_][a-z0-9_]*|h([a-df-z0-9_][a-z0-9_]*|e([a-qs-z0-9_][a-z0-9_]*|r([a-df-z0-9_][a-z0-9_]*|e[a-z0-9_]+)?)?)?)?)|
[ekpqtvxyz0-9_]+)[ ]*\(>>

Steffen Gaede.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]