Re: [racket] How write regexp for lexer

2013-09-26 Thread Бомбин Валентин
Thanks. 26.09.2013, 06:39, "Evgeny Odegov" : >>  I want to different two kind types of comment - first - is comment which >>  begin from start line (first symbol of line is '/' or whitespaces and '/' >>  ), second - is comment which start with '/' but beffore was reading any >>  other symbol (exc

Re: [racket] How write regexp for lexer

2013-09-25 Thread Evgeny Odegov
> I want to different two kind types of comment - first - is comment which > begin from start line (first symbol of line is '/' or whitespaces and '/' > ), second - is comment which start with '/' but beffore was reading any > other symbol (except whitespaces) > Javascript regexp for it is "^//.*\n

Re: [racket] How write regexp for lexer

2013-09-25 Thread Бомбин Валентин
Thansk for answer, but it can't help. Simple example latter - #lang racket/base (require racket/string parser-tools/lex (prefix-in : parser-tools/lex-sre)) (define-tokens my-tokens (BCOMMENT COMMENT OT)) (define-empty-tokens my-empty-tokens (EOF NEWLINE)) (define-lex-abbre

Re: [racket] How write regexp for lexer

2013-09-25 Thread Evgeny Odegov
Валентин, maybe this short example could help http://pastebin.com/ncZpH49E > > Hello. I need write rule for lexer for recognize comment which begin from > first column of line. > I have next regexp for comment (:seq "//" (:* (:~ CR LF))), aftrer add > cr/lf to begin of expression i write (:seq L

[racket] How write regexp for lexer

2013-09-25 Thread Бомбин Валентин
Hello. I need write rule for lexer for recognize comment which begin from first column of line. I have next regexp for comment (:seq "//" (:* (:~ CR LF))), aftrer add cr/lf to begin of expression i write (:seq LineTerminator (:* (:or #\space TAB FF)) "//" (:* (:~ CR LF))), but this regexp -fi