dasunpubudumal / lex-yacc

A simple Parser and a Lexical Analyzer using Lex (Flex) and Yacc (Bison)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lex-yacc

Description

A simple Lexical Analyzer and a Syntax Analyzer for the language C- defined as below.

Pic One (Figure 1)

Pic Two (Figure 2)

  • lexer.l is the Lexical Analyzer.
  • parser.y is the Parser (Syntax Analyzer)
  • lex.yy.c is the compiled file from lexer.l

To Run:

  • Linux - Use ./compiler < testfile.c

In a need of compilation, run the makefile using make -f MAKEFILE (Linux).

About

A simple Parser and a Lexical Analyzer using Lex (Flex) and Yacc (Bison)


Languages

Language:Yacc 47.2%Language:Lex 38.0%Language:C 14.5%Language:C++ 0.3%