Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C/C++/C#/VB based Lexical Analyzers

During the Compiler Design Lab hours, I'm using JLex as the Lexical Analyzer Generator, which produces a Java program from a lexical specification.

I'd like to know if there are other tools which can help me in the same by generating C/C++/C# or VB programs instead of a Java program, and can run in Windows.

like image 358
Arjun Vasudevan Avatar asked Aug 29 '10 10:08

Arjun Vasudevan


3 Answers

  • C#
    • GPLEx is a generator for lexical scanners accepting a “LEX-like” input specification and produces a C# output file (C# 2 with generics).
    • Grammatica is a C# and Java parser generator
    • ANTLR parser generator that supports generating code in C, Java, Python, C#, and Objective-C
    • C# Lex
    • C# Flex
  • Java
    • JLex
    • JFLex
    • ANTLR
    • Grammatica
    • Ragel is a finite state machine compiler with output support for C, C++, Objective-C, D, Java and Ruby source code
  • C/C++
    • Lex
    • Flex
    • Flex++
    • ANTLR
    • Quex
    • Ragel
like image 92
Julien Hoarau Avatar answered Nov 13 '22 17:11

Julien Hoarau


Lex (and its variants like Flex) should be a starting point. You can download the Windows ports of these to get started. The output is in C. Additionally, look for yacc and bison if you want parser generators too. Here is a comprehensive page for all four.

like image 4
dirkgently Avatar answered Nov 13 '22 18:11

dirkgently


Ragel can generate fast lexical analyzers from a regular language in C, C++, Objective-C, D, Java, and Ruby.

like image 1
Hasturkun Avatar answered Nov 13 '22 16:11

Hasturkun