Skip to main content
0 votes
0 answers
38 views

I'm building a LALR grammar for a language where ">" can be either a) the greater-than operator b) the closing bracket of a "<" ... ">" construct (tuple literal) ...
Wiktor Tomczak's user avatar
1 vote
1 answer
72 views

I have a file contents. if the final line has a NL at the end, i get 2 token trees as expected, but of the file doesn't have a final NL, i end up with 3 trees which is unwanted. How do i get lark to ...
K P's user avatar
  • 13
2 votes
1 answer
78 views

I wrote this grammar to describe a simple patch procedure we use at work, operating on source code files. Engineers check in files of the form: {ignored space} //find_start {possible comment or ...
Ryan Brothers's user avatar
0 votes
1 answer
60 views

I would need to build a Tree that would retrieve something like this using Lark package: start expr or_expr and_expr comp_expr identifier Name comparator ...
francollado99's user avatar
0 votes
0 answers
30 views

I'd like to catch some word in text (say, "var"). So the rules rules = r""" start: expr+ expr: var | anything var.2: VAR anything: ANYTHING ANYTHING: /[\...
Igor Seliverstov's user avatar
0 votes
0 answers
48 views

Can one assign multiple aliases for a terminal or rule in Lark ? Consider the following grammar coordinate : "(" X "," Y ")" %import common.SIGNED_NUMBER -> X %import ...
Carel's user avatar
  • 3,417
0 votes
1 answer
87 views

I'm making early steps with the Lark library in Python and am really looking forward to replacing a lot of awful if statements with an EBNF parser..! The task here is interpreting the times written in ...
Jack Deeth's user avatar
  • 3,509
2 votes
2 answers
139 views

I have a processor trace output that has the following format: Time Cycle PC Instr Decoded instruction Register and memory contents 905ns 86 00000e36 00a005b3 c.add ...
ex1led's user avatar
  • 479
1 vote
0 answers
58 views

I would like to parse the following PlantUML which likes flow-charts, by using python lark package. The syntax of each action is based on verilog-hdl. PlantUML @startuml :[7:0] a; :write(reg01, 8'h01, ...
Asustor's user avatar
  • 21
0 votes
1 answer
124 views

I am new to lexers and parsers in general and to working with Lark in particular. I am using the versions lark 1.1.9 and interegular 0.3.3. I started writing a grammar which produces a warning when ...
xylophone's user avatar
1 vote
0 answers
40 views

I want blank new lines to be syntactically significant (optimization for leaf leaning trees [[[a, b], c, d], e, [g], f] == [a b | c d | e [g] f] but with \n\n instead of |). But the only way I can ...
Tom Huntington's user avatar
0 votes
1 answer
187 views

I dont want the func rule here, it's merely to avoid repetition. func: monad | dyad | builtin dyad: "{" dyad* func+ "}" | func+ ":" monad: "(" monad* func+ &...
Tom Huntington's user avatar
0 votes
1 answer
128 views

I have a (Lark) grammar that I think should be unambiguous, but depending on the version of Lark, fails to parse in one way or another: import lark syntax = r""" stmt: mov_stmt | ...
Jonathon Reinhart's user avatar
0 votes
2 answers
177 views

I defined the following grammar: from lark import Lark grammar = r''' start: ( bold_text | text) bold_text.2: "**" text "**" text.1: /.+/ ''' parser = Lark(grammar, ...
Jonas's user avatar
  • 3
1 vote
1 answer
160 views

I want to parse through a SQL Select Statement that has all the features a normal SQL dialect like MySQL has too. I looked for parsing libraries in python but couldn't find one that is doing the job. ...
Alexander Chereji's user avatar

15 30 50 per page
1
2 3 4 5
8