Skip to content

intersimone999/code-lexer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Lexer

Gem Version

This gems allows to tokenize any programming language through a simple specification file.

Install

To install the latest version, simply run the following command

gem install code-lexer

Examples

js_lexer = CodeLexer.get("javascript")
js_lexer.lex("return 0;").token_stream # → "return ¬·¬ 0 ;"

abstractor = CodeLexer::Abstractor.new.remove_spaces.abstract_identifiers
js_lexer.lex("a = b + c + b").token_stream(abstractor) # → "¬ID1¬ = ¬ID2¬ + ¬ID3¬ + ¬ID2¬"
abstractor.dictionary # → ["a", "b", "c"]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •