Skip to content

SeanTse/promlexer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

promlexer

promlexer is a tool built with JFlex to tokenize prometheus format text (metrics). It's basically based on the prometheus promlex.l. But unlike the Prometheus, it drops the lines begin with a character #, e.g., HELP lines and TYPE lines. You can run the following maven command to build your lexer:

mvn clean package

There is also a demo shows a way of using this little lexer.

License

There is NO WARRANTY for promlexer, its code and its documentation.

JFlex vs Antlr

According to this paper[1], Antlr has an O(n4) theoretical computation complexity while JFlex has an O(n) one. So I choose JFlex over Antlr.

References

[1] Ortin, F., Quiroga, J., Rodriguez-Prieto, O. and Garcia, M., 2022. An empirical evaluation of Lex/Yacc and ANTLR parser generation tools. Plos one, 17(3), p.e0264326.

About

A lexer for prometheus built on JFlex

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors