Questions tagged [sedlex]

5 questions
2
votes
1 answer

Type Sedlexing.lexbuf is not compatible with type Lexing.lexbuf

I would like to add incremental API and error handling of menhir to my project by sedlex+menhir; I'm trying to adopt attempt2 and fail of this sample to my code. Here is the attempt2 of the sample: let attempt2 filename text = (* Allocate and…
SoftTimur
  • 5,630
  • 38
  • 140
  • 292
1
vote
1 answer

Any character other than

I have defined a token for ocamllex let non_line_termination_character = [^ '\x0D' '\x0A'], which represents any character other than '\x0D' and '\x0A'. Now, I would like to translate it to sedlex. Does anyone know how to translate it correctly?…
SoftTimur
  • 5,630
  • 38
  • 140
  • 292
0
votes
0 answers

OCaml lexing and parsing with whitespace sensitivity

im building a parser with Sedlex and Menhir, where i have a function definition as: (* Lexer *) let non_ascii = [%sedlex.regexp? '\160' .. '\255']; let escape = [%sedlex.regexp? unicode | ('\\', Compl('\r' | '\n' | '\012' | hex_digit)) ]; let…
udduu
  • 69
  • 4
0
votes
2 answers

Characters and digits of Chapter four of the Unicode Standard

In a language specification, there is name-start-character= '_' | '\' | ? any code points which are characters as defined by the Unicode character properties, chapter four of the Unicode Standard ?; Could anyone tell me how to correctly represent…
SoftTimur
  • 5,630
  • 38
  • 140
  • 292
0
votes
2 answers

Identify what slows down the compilation of a lexer

I have a lexer and parser, built with sedlex and menhir in OCaml, to parse spreadsheet formulas. The following part of the lexer defines regular expressions for the path+workbook+worksheet part before a reference. For instance,…
SoftTimur
  • 5,630
  • 38
  • 140
  • 292