Questions tagged [smie]

SMIE (Simple Minded Indentation Engine) is a package that provides a generic navigation and indentation engine. Based on a very simple parser using an “operator precedence grammar”, it lets major modes extend the sexp-based navigation of Lisp to non-Lisp languages as well as provide a simple to use but reliable auto-indentation.

Filter by
Sorted by
Tagged with
8
votes
0answers
701 views

How do I parse a simple grammar and obtain a syntax tree in Emacs lisp?

How can I construct a parse tree from a string and a simple grammar? Semantic seems very tricky, and SMIE does not seem to produce a parse tree. Here's an example, assuming a language that looks like ...
6
votes
1answer
331 views

Parsing parentheses: smie vs syntax table

I am maintaining a mode for a programming language with... let's say "annoying" syntax constructs. For example, the angle brackets (no idea if it is the correct word) < and > are parentheses. ...
3
votes
2answers
81 views

SMIE Basic Identation and Block Example

I've tried for a while to create a simple major mode that uses SMIE to perform navigation and indentation, but it seems like even the simple examples that I've found seems to break quite easily. The ...