SergySanJj / RubyLexer

Lexer for Ruby programming language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RubyLexer

Lexer for Ruby programming language

Overview of techniques used to create this lexer can be found in book of

Aho A.V., Sethi R., Ullman J.D. "Compiler Principles, Techniques and Tools"

Implemented language highliting features

  • identifiers (local, global, class, instance variables; class and function names);
  • keywords;
  • operators;
  • boolean literals and nil;
  • number literals (signed, unsigned integers and doubles; numbers in exponential form);
  • symbols and HEREDOC literals;
  • comments;
  • string and multiline string literals;
  • punctuation;
  • error tokens;

Example of lexer results in HTML representation:

alt text

I/O

Input file for lexer is located in /RubyLexer/input/ruby_test_file.rb

Output file in form of html document can be found in /RubyLexer/output/index.html

About

Lexer for Ruby programming language


Languages

Language:HTML 52.8%Language:Java 42.9%Language:Ruby 4.3%