- Inherits from:
- Object
- Declared in:
- DSource.h
Object
|
+---DSource
Class Description
The DSource class is used by the class DLexer and the class DTokenizer for
storing the relevant info of the source for the lexer c.q. tokenizer. By storing
the objects in a list, a stack of sources can be implemented.
- Last modified:
- 12-Nov-2005 (DSource.h)
Instance Variables
- private id <DTextReadable> _source
- the reference to the source (file)
- private DText *_name
- the name of the source (file)
- private DText *_line
- the read line
- private int _lineNr
- the line number
- private int _columnNr
- the column number
- private int _scanned
- the scanned part of _line
- Constructors
- - (DSource *) init
- Initialise an empty source object
- Returns:
- the object
- - (DSource *) init :(id <DTextReadable>) source :(const char *) name
- Initialise a source object with a source
- Parameters:
- source - the reference to the file
name - the name of the file
- Returns:
- the object
- Copy related methods
- - deepen
- Deepen a copy of the object
- Returns:
- the object
- Deconstructor
- - free
- Free the object
- Returns:
- the object
- Member methods
- - (int) columnNumber
- Get the current column number
- Returns:
- the column number
- - (const char *) line
- Get the remaining line of text
- Returns:
- the remaining line of text
- - (int) lineNumber
- Get the current line number
- Returns:
- the line number
- - (const char *) name
- Get the name of the source
- Returns:
- a (new) DText with the name
- Main methods
- - (BOOL) appendLine
- Append the next line to the current line
- Returns:
- success
- - (DSource *) error :(const char *) msg
- Generate an error on stderr for the current file and line
- Parameters:
- msg - the error message
- Returns:
- the object
- - (BOOL) isLineScanned
- Check if the current line is fully scanned
- Returns:
- is it ?
- - (BOOL) nextLine
- Move to the next line
- Returns:
- success
- - (BOOL) scanned :(unsigned) length
- Indicate that a part of the line is scanned
- Parameters:
- length - the length of the scanned part
- Returns:
- is the whole line scanned ?
- - (BOOL) set :(id <DTextReadable>) source :(const char *) name
- Set the source definition
- Parameters:
- source - the reference to the file
name - the name of the file
- Returns:
- success
generated 08-Jan-2006 by ObjcDoc 3.0.0