Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Python lexical scanner

Reply
Thread Tools

Python lexical scanner

 
 
cricket
Guest
Posts: n/a
 
      09-25-2003
i need help with Python lexical scanner for this assignment, i have
create a scanner using the Flex scanner generating tool. The
requirements of the scanner are as follows:

1) Accept input via stdin (standard input).
2) Return output via stdout (standard output)
3) Recognize tokens of the Python programming language
3.1) Tokens are grouped into the following categories:
Newline
Indent
Identifiers
Keywords
Literals
Operators
Delimiters
For INDENT tokens, the format should be

<#> - INDENT - <indent level>


i need help with INDENT,Literals and Newline every time i used \n for
newline it did not work i even used [\n] still did not work.
The scanner should output the tokens discovered in the form:

<#> - <token category> - <token spelling>
for example
10 keyword while or if



Thank you
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where find regexs needed to build lexical analyzer for Python sourcecode? Chris Seberino Python 1 09-12-2009 04:41 AM
Lexical scope: converting Perl to Python Andrew Savige Python 3 06-13-2009 08:11 PM
lexical analysis of python robert.muller2@gmail.com Python 3 03-11-2009 05:36 AM
python: lexical or dynamic scope? globalrev Python 3 05-14-2008 01:28 PM
python newbie - question about lexical scoping Matt Barnicle Python 10 12-02-2007 08:59 PM



Advertisments