Devam Ediyor

Lexical analyser and Syntactic parsing

Phase 1

The user enter a code in Mini C language (described below). The analyser tokenizes the code into tokens according to white spaces and symbols. Each token is assigned to a valid type and line number. The description of types are below. You have to write a regular expression for each type. For assigning a type for a token you can use the following algorithm:

Your program should have one GUI interface that have:

text box to type a code by the user. Textbook to show the errors if any. 2 buttons one for lexical analyser and the other for syntax parsing. An option to upload a text file.

* The lexical analyser reads any code from a textbook or a file (note that multi-spaces are accepted as one space for tokenization) 


* You should use regular expressions to identify types of the tokens. 


* Output: Identify the lexical errors with a clear message. 


* Output: a list of (line number, token, type) should be generated in a text file with all 
errors exist. 


* The user can modify the code from the screen and rescan again. 


Note: This phase concerns on the tokens regardless the syntax structure of the statements. For example: the tokens in a statement (x int =5;) are accepted; but one token is not accepted in (3int x=5;) as 3int is not accepted in all DFA we have. Thus you should report a lexical error with line number.


Mini C language:


This language is a subset of C language just to practice compiler design process. It contains a set of primitive types (that you have to write a regular expression for each) and other types that will be used in the grammars in the syntax phase.


Primitive types: Digit, letter, INT_NUM, FLOAT_NUM, ID, Void


STR is a type of string which has numbers/spaces/letters/symbols


Token *\ Type: END COMMENT. Token: /* Type: BEGIN COMMENT.


Token: if Type: IF. Token: Token: * Type: MULT. Token else Type: ELSE. And so on..

The syntax is similar to C language that has:


Control statements (if, loops,...) and nested statements 


Declarations will be in format (variables: type) all variables must be declared at the beginning of the program or function.

Function will be in format (function_name: type(list of parameters){}),

recursive call is also accepted Blocks of code will be in format { code }


It is not case sensitive (small/capital letters are the same).

The project submission requirements:

* A report with a brief description of the compiler phases. 


* Regular expression and types of the programming language 


* Snapshots of the lexical analyser input and output. 


* The context free grammars for the syntax using the description and the start symbol will be: Program -> Proram_name srart: Declarations functions body 


* The code.

* A video of how to run the program with correct and incorrect input.

Ex: 


TestProgram start:


Var1, Locvar1,age Integer

var1:=5


func1: Void (var2 integer) {

print ( var2)


}


Locvar1:=var1+6-2


enter( age)


if (4+2 == var1*2) then {

print(“good”, age)

func1(var1)


} 


Phase 2

a) You will use the grammars in phase1 after getting the feedback from the instructor. Using one of the available syntactic parsing tool, you will generate the LALR parsing table.

b) Either use a parsing tool component or Implement LR parser using the parsing table generated automatically from (a) to parse the code entered by the user in phase 1. Your parser should tell if there is syntax errors and line number of the error.

c) You should integrate the two phases in one program and GUI that has two buttons (lexical parser and syntax parser).

Note: if you should to implement a parser you will get 3 marks.

The project submission requirements:

* The parsing table and which tool is used

* The code of the LR parsing.

* A video of how to run the program with correct and incorrect input.

* Note the error message should be meaningful with the line number

Beceriler: C Programlama, C# Programlama, C++ Programlama, Yazılım Mimarisi, Visual Basic

Daha fazlasını görün: The aim of this assignment is to implement a lexical and syntax analyser using JavaCC for a simple language called CCAL., Dear Sir, My design is completely editable if you need. Please notify me for any kind of exceptional customization and your valu, where to begin if u wanted to learn for an accountant, vba finding figure numbers string, extract phone numbers string excel, extract phone numbers string php, parse numbers string bash, extract numbers string, java ectract numbers string, generate phone numbers string, extract numbers string java, php extract phone numbers string, php extract numbers string phone number, extracts numbers string stepping vb6, phpnet php parsing writing xml, dnis number parsing, xml parsing error solution, nested pull menus, perl xml parsing csv, parsing postscript, nested radio buttons html java htmlradio, java parsing text file, java text file parsing, asp classic find numbers string, free email parsing http post

İşveren Hakkında:
( 2 değerlendirme ) Riyadh, Saudi Arabia

Proje NO: #13796631

Seçilen:

hbxfnzwpf

I am very proficient in c and c++. I have 16 years c++ developing experience now, and have worked for more than 7 years. My work is online game developing, and mainly focus on server side, using c++ under Linux environ Daha fazlası

5 gün içinde 100$ USD
(121 Değerlendirme)
6.9

7 freelancer bu iş için ortalamada 141$ teklif veriyor

wangbeizou

Hello. How are you today. I have read and understood the project. I have strong knowledge in Data structures and Algorithms. And I'm expert in Java ,C/C++,C#, Python ,PHP etc. I'm interested this project. So, fi Daha fazlası

in 5 gün içinde200$ USD
(113 Değerlendirme)
6.0
schoudhary1553

Greetings sir, i am an expert freelancer for this job and your 100% satisfaction is assured if you allow me to serve. Here is the reason. Why you should pick me? a) I am a very expert and have the same kind of ex Daha fazlası

1 gün içinde 300$ USD
(61 Değerlendirme)
5.9
iridescent2x15

I m software engineer. I have read the description and I would like to work for you. For further details please inbox me. Thank you

1 gün içinde 300$ USD
(41 Değerlendirme)
5.3
BeautiCG

Hi,dear. I am a senior software developer. I have just checked your project report, I am able to perform this task with my developer team. I am looking forward to your proposal...

1 gün içinde 25$ USD
(18 Değerlendirme)
4.5
1 gün içinde 111$ USD
(1 Değerlendirme)
1.0
techfinity3

Dear Client, Thanks for providing us opportunity to place bid over the project and communicate with [url removed, login to view] mainly deal in web development, SEO, Android App, software testing and graphic design. Our vision is to b Daha fazlası

in 6 gün içinde26$ USD
(0 Değerlendirme)
0.0
in 6 gün içinde26$ USD
(0 Değerlendirme)
0.0
vw7888219vw

Krishantha (Software Engineer) Windows base software develop using C#, vb .net MS SQL Crystal report. I have more than 5 year experience as software engineer. Graduated in university of Moratuwa,Sri lanka- Bachelor of Daha fazlası

1 gün içinde 25$ USD
(0 Değerlendirme)
0.0
in 3 gün içinde35$ USD
(0 Değerlendirme)
0.0