clex
JFlex
clex | JFlex | |
---|---|---|
9 | 1 | |
87 | 574 | |
- | 0.9% | |
3.0 | 4.3 | |
about 1 year ago | 8 months ago | |
C | Java | |
MIT License | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
clex
- clex is now thread-safe and instance-based, a lexer generator for C
-
Show HN: Clex is now thread-safe and instance-based A lexer generator for C
https://github.com/jafarlihi/clex
I very recently updated clex to be instance-based (instead of being a single global instance) and thread-safe based on previous feedback.
clex lets you programatically generate lexers in your C program without going through extra intermediary generation/compilation step, and now you can have more than one in your application!
There’s also cparse: https://github.com/jafarlihi/cparse
It lets you generate LR(1) and LALR(1) parsers in much the same way, and it uses clex under the hood. It’s currently not updated to the latest version of instance-based clex but it is in my plans to do so soon.
Feedback and contributions are appreciated!
-
GitHub - jafarlihi/cparse: cparse is a simple LR(1) parser generator for C
As with clex, I strongly encourage you to do all your testing using -fsanitize=address,undefined since you'll catch these issues sooner. Also, as I had demonstrated on clex, a dozen-line arena allocator can solve all your memory leaks quite easily.
- GitHub - jafarlihi/clex: clex is a simple lexer generator for C
- Show HN: Clex – simple lexer generator for C
JFlex
-
How to write your own language plugin for IDEA (part 1)
Perhaps, the easiest way to create a lexer for IDEA is to use JFlex. The GrammarKit plugin already contains implementation and allows you to generate a lexer from .bnf file or from .flex file (with more customization options). An example for the Monkey language can be viewed here, a more complex one for Frege - here.
What are some alternatives?
apli - The Abstract Programming Language Interface (APLI) is a framework for generating Abstract Syntax Trees (ASTs) to enable developers to create domain-specific languages faster.
ANTLR - ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.