468,167 Members | 1,956 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,167 developers. It's quick & easy.

Python lexical scanner

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
Jul 18 '05 #1
0 1602

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

699 posts views Thread by mike420 | last post: by
25 posts views Thread by mike420 | last post: by
4 posts views Thread by Michael | last post: by
4 posts views Thread by bariole | last post: by
267 posts views Thread by Xah Lee | last post: by
852 posts views Thread by Mark Tarver | last post: by
25 posts views Thread by Lennart Benschop | last post: by
3 posts views Thread by globalrev | last post: by
reply views Thread by kamranasdasdas | last post: by
reply views Thread by gcreed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.