Implementating a Scanner and Parser for a Simple Language

A compiler converts a source language program into a target language program. There are some basic stages in compilation process, including scanning, parsing, semantic analysis, and code generation. For this assignment, you will implement a scanner and parser for a small language with its grammar given in BNF notation. The language literals are enclosed with ' ' in the CFG below.

Context Free Grammar:

<program> -> <stmtlist>'end'

<stmtlist> -><stmt>| <stmt><stmtlist>

<stmt> -> ID '=' <expr>

|'read' ID

|'write' <expr>

<expr> -> <term> {('+'|'-')<term>}

<term> -> <factor> {('*'|'/') <factor>}

<factor> -> ID



The possible set of tokens, represented with regular expressions, includes:


PLUS -> +

MINUS -> -

TIMES -> *

DIV -> /



ID -> letter(letter|digit)*

Except read, write, and end.

INT_CONSTANT -> digit digit*

LETTER ->[a-zA-Z]

DIGIT ->[0-9]

Your task is to implement a scanner and a parser for this simple language.


1. You may use any language of your choice to write your program. However, your program must compile and run on pluto.

2. Programs can be read from keyboard instead of file.

Submission notes

1. All your source code

2. Brief documentation or readme file (i.e. no more than a page), to include the following

a. Instructions on how to build and execute your program

b. Any difficulties you encountered in designing/writing your program

c. What you learn/find from or reflection of this assignment.

Skills: Java, Python, R Programming Language

See more: difference between scanning and parsing, c++ lexer example, scanning process in compiler design, what is scanner in compiler design, lexer for c language, simple lexer in c, scanner in compiler construction, writing a lexer in c, The aim of this assignment is to implement a lexical and syntax analyser using JavaCC for a simple language called CCAL., simple language interpreter, scanner parser, simple project scanner parser programming, php simple language translator, write scanner using imperative language java, write scanner using imperative language java python, simple scanner parser evaluate, scanner parser simple, cms simple language navigation, android simple language, wikitext scanner parser java

About the Employer:
( 4 reviews ) shippensburg, United States

Project ID: #15149892

Awarded to:


Hi, I teach compiler courses in a university. I have implemented projects like this one several times in the past. I can do it on any language you need Relevant Skills and Experience Compilers, C, C++, Python, Ruby More

$35 USD in 2 days
(72 Reviews)

9 freelancers are bidding on average $30 for this job


Hi there. I went through the requirements and I would like to do this project if given the opportunity. I have do ne parser related projects before.

$35 USD in 3 days
(1001 Reviews)

I am very proficient in java. I have 16 years java developing experience now, and have worked for more than 6 years. My work is online game developing, and mainly focus on server side, using java under windows environm More

$30 USD in 1 day
(47 Reviews)

Hey A compiler construction expert is here I can write a compiler for you as per your need I have good advanced expertise in Context Free Grammer and semantics analysis Feel Free to message me Regards Relevant Skills More

$25 USD in 0 days
(73 Reviews)

A proposal has not yet been provided

$30 USD in 2 days
(0 Reviews)

I'm an expert on this work

$25 USD in 1 day
(0 Reviews)
$25 USD in 1 day
(0 Reviews)
$30 USD in 1 day
(0 Reviews)

I am a serious bidder with similar technical skills and experience i have checked the details & have already worked on a similar project before and can deliver this as u have mentioned Stay tuned, I'm still work More

$31 USD in 1 day
(0 Reviews)