language-python-0.5.6: Parsing and pretty printing of Python code.

Copyright(c) 2009 Bernie Pope
LicenseBSD-style
Maintainerbjpop@csse.unimelb.edu.au
Stabilityexperimental
Portabilityghc
Safe HaskellNone
LanguageHaskell98

Language.Python.Version3.Lexer

Contents

Description

Lexical analysis for Python version 3.x programs. See: http://docs.python.org/3.1/reference/lexical_analysis.html.

Synopsis

Lexical analysis

lex Source #

Arguments

:: String

The input stream (python source code).

-> String

The name of the python source (filename or input device).

-> Either ParseError [Token]

An error or a list of tokens.

Parse a string into a list of Python Tokens, or return an error.

lexOneToken Source #

Arguments

:: String

The input stream (python source code).

-> String

The name of the python source (filename or input device).

-> Either ParseError (Token, String)

An error or the next token and the rest of the input after the token.

Try to lex the first token in an input string. Return either a parse error or a pair containing the next token and the rest of the input after the token.

lexer :: P [Token] Source #

Lex a sequence of tokens.