TTTK2163 Assignment 2 - Regular Expression


Write a regular expression that can identify all tokens in a Java Language. For full marks: include the description of the tokens and show any 5 tokens that applies your regular expression.

TTTK2133 - Data Communications and Networking Books

This book i bought is RM67 from my jabatan office, but if you dun wan to buy can download the Data Communications and Networking Books E-Books from here !!Is totally free!!

TTTK2133 - Data Communications and Networking Notes


Chapter 1 - Chapter 32

Pendaftaran Kursus Semester II Sesi Akademik 2009-2010





21 Dis 2009


Pendaftaran kursus bagi pelajar yang tibak membuat pendaftaran awal dan pelajar gantung pendaftaran semester I, Sesi Akademik 2009-2010.

Semua tempat yang mempunyai capaian internet.

21 Dis 2009 hingga

3 Jan 2010


Tambah / Gugur kursus.

Semua komputer yang mempunyai capaian internet.

4 Jan 2010


17 Jan 2010


Gugur kursus.

Semua komputer yang mempunyai capaian internet

18 Jan 2010


14 Feb2010


Tarik diri kursus sahaja.

Semua komputer yang mempunyai capaian internet.

18 Jan 2010


24 Jan 2010


Pengesahan pendaftaran kursus.

Semua komputer yang mempunyai capaian internet.


Due to the error cant access TTTM1813 - PENGANTAR SAINS SOSIAL in SPIN to download notes, You can download notes ( Lesson 1 - 3 ) from here download link.

Assignment 1- How JFlex works?


Write comprehension notes not more than 5 pages on how JFlex works. Relate your notes with the execution of the simple.flex

Answer :

JFlex takes a JFlex program and creates a Java file. I give the JFlex program a suffix of “.jflex”, although this is not compulsory. The default name for the Java class generated is Yylex, and the code is written to a file called, although this can be changed, using the %class directive.

There are two provided constructors for the lexical analyser class. The primary one takes a Reader object as a parameter. The secondary one takes an InputStream, which it converts into a Reader and invokes the primary constructor. The parameter represents an object that provides the input to be lexically analysed. For example, the parameter can be a StringReader (if we want to obtain theinput from a String) or an InputStream (if we want to obtain the text from a file).

The lexical analyser class has a method for getting a token. The default name for this method is yylex(), although this can be changed, using the %function directive. The default return type is Yytoken, although this can be changed, using the %type directive. This method loops, matching the input to regular expressions, and performing the action associated with that regular expression. If the action contains a return statement, the method returns the value indicated.

Installation JFlex

Unzip the file you downloaded into the directory you want JFlex in. Open the bin folder then click the .bat jflex file and edit the where your directory install JAVA and JFLEX.

How to work with JFlex

Browse the lib folder and click on JFlex(Executable Jar file) to use .

Click the “Browse” button to select the file simple.flex from the location simple folder and click “Generate” button. After that, it will generate the

The massage will shown that analyser generator first read the simple.flex file. After that follows by constructing NFA in 165 states. Next step is to convert the NFA into DFA along with the process of minimized the states. Finally, the new path of the file is generate and process successfully done. contains a scanner class that generated by simple.flex. The class can prints debugging information about each token until reached the end of file or an error is occurred. This scanner class will be used to check our input file.

You can by using BlueJ to open the and

Related Posts with Thumbnails