[erlang-questions] Leex Character Class Complement
Robert Virding
rvirding@REDACTED
Sat May 29 04:04:10 CEST 2010
No, there is no way to do this in leex today and it is not something I
have in the pipeline.
Robert
On 29 May 2010 00:09, Brady McCary <brady.mccary@REDACTED> wrote:
> erlang-questions,
>
> I would like to have the complement of a character class in a leex
> file, or to be able to subtract character classes. An example xrl file
> is as follows:
>
> %%% ---- Beginning of test.xrl ----
>
> Definitions.
>
> A = [ab]{-}[b]
>
> Rules.
>
> {A}+ : {token, {a, TokenLine, TokenChars}}.
>
> Erlang code.
>
> % Nothing
>
> %%% ---- End of test.xrl ----
>
> Compiling test.xrl and using is as follows:
>
> 1> leex:file(test,[{verbose, true}]), c(test), test:string("a").
> Parsing file ./test.xrl, contained 1 rules.
> NFA contains 9 states, DFA contains 6 states, minimised to 6 states.
> Writing file ./test.erl, ok
> {error,{1,test,{illegal,"a"}},1}
>
> In the above test.xrl, I would hope that A = [a]. and that the rule
> {A}+ would match the string "a", but it is not so. Does anybody know
> how to do this? The reference for the analogous flex implementation of
> the subtraction operator is (search for {-} on the page):
>
> http://flex.sourceforge.net/manual/Patterns.html#Patterns
>
> Brady
>
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
>
>
More information about the erlang-questions
mailing list