StreamReader

This module co-ordinates the reading of the source file.

It maintains the current position of the parser in the source file.

Copyright (c) by Jay Love, 2000 (mailto:jsliv@jslove.org)

Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee or royalty is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation or portions thereof, including modifications, that you make.

This software is based in part on work done by the Jakarta group.

class PSP.StreamReader.Mark(reader, fileId=None, stream=None, inBaseDir=None, encoding=None)

Bases: object

This class marks a point in an input stream.

__init__(reader, fileId=None, stream=None, inBaseDir=None, encoding=None)
getFile()
popStream()
pushStream(inFileId, inStream, inBaseDir, inEncoding)
class PSP.StreamReader.StreamReader(filename, ctxt)

Bases: object

This class handles the PSP source file.

It provides the characters to the other parts of the system. It can move forward and backwards in a file and remember locations.

__init__(filename, ctxt)
advance(length)

Advance length characters

getChars(start, stop)
getFile(i)
hasMoreInput()
init()
isDelimiter()
isSpace()

No advancing.

mark()
matches(s)
newSourceFile(filename)
nextChar()
nextContent()

Find next < char.

parseAttributeValue(valueDict)
parseTagAttributes()

Parse the attributes at the beginning of a tag.

parseToken(quoted)
peekChar(cnt=1)
popFile()
pushFile(filepath, encoding=None)
registerSourceFile(filepath)
reset(mark)
skipSpaces()
skipUntil(s)

Greedy search.

Return the point before the string, but move reader past it.