pombredanne / tokenizer-1 Goto Github PK
View Code? Open in Web Editor NEWTokenizer for subset of C language by using DFA
Tokenizer for subset of C language by using DFA
Author: Chunpai Wang Email: [email protected] CSC254 HWK02 : Tokenizer This folder contains 3 files: 1. input_file.c : c program for tokenization 2. tokenizer.py : python2.7 script to tokenize the input_file and return a new output_file 3. README : this file How to run this program: In terminal: python tokenizer.py input_file.c Program Description: This program contain two classes. One is Token and the other is Scanner. Each token in Token class has two attributes, name(token type) and value. Scanner has next_token() function, which is the main part of this program. Check specific comments in the codes. Scanner will read a C input file char by char, and detect the valid tokens, such as reversed words, identifiers, numbers, meta_statements, and string. And then it also adds '_cs254' after each identifers, and write the new program in the output_file.c Also, this program will print the tokens(name and value) in the console. In addition, it also announces 'ERROR!!!' when detect illegal tokens, like '2010i', '!', and '/*--' without '*/'.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.