[Top][All Lists]

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

SMIE examples and questions

From: Aurélien Aptel
Subject: SMIE examples and questions
Date: Thu, 25 Jun 2020 11:21:18 +0200


Are there *simple* complete examples of SMIE out there? I find the
manual not that helpful to get started and existing modes look pretty
complex :(

Is the forward lexer required or is the backward one enough?
What are the assumptions of SMIE regarding the lexer?
- What should it return when there is nothing to read (eg backward and
begining of buffer)?
- I assume if the point is in the middle of a token, it should return
the complete current token (including text after point) and place the
point at token start?
- Does point position matter regarding spaces (assuming they have no
meaning)? Is it ok if the lexer places the point sometime after and
sometime before them?
- Can I safely call it manually without involving SMIE?
- I assume backward and forward lexer should always have the same
behaviour, even for spaces?

I understand there is no way to dump the AST after parsing, and that
grammar errors not being reported is a feature. How am I supposed to
debug parsing/indenting? If you have any tips or workflow, like the
more practical order to implement things, or how to debug that would
be greatly appreciated.


reply via email to

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