Class program_reader

@LineNumberInc 10 The class will read a ProvideX program either from a source text file or tokenized program.

Build Information

Author Fred McGuirk
Outputfile program_reader.pvc

Constructor

Create a reference the to appropriate class to read the specified program file. This class will use either [ProvideX Class:pvx_tokenized_reader] or [ProvideX Class:pvx_source_reader] as necessary to allow reading either a tokenized program or a text file of the program source.

ParameterDescription
inFile$ The name of file to read
inPassword$ **Optional** The password to decrypt a tokenized program
inPathResolver **Optional** A reference to a [ProvideX Class:path_resolver] class to expand the name of include files.

Properties

PROPERTY _version$

PROPERTY changeKeywords

PROPERTY convertLineLabels

Methods

FUNCTION getCreateObj$()

Get the object instatiation(s) within the current program line

Returns A string containing a space separated list of object instantiations
FUNCTION getCreateObj$(aPgmLine$)

Get the object instatiation(s) within the current program line

ParameterDescription
aPgmLine$ The program line to use (NULL value will use current program line)
Returns A string containing a space separated list of object instantiations
FUNCTION getCreateObj$(aPgmLine$, aSepChar$)

Get the object instatiation(s) within the current program line

ParameterDescription
aPgmLine$ The program line to use (NULL value will use current program line)
aSepChar$ The character to use to separate each member of the list; if not set will default to a space.
Returns A string containing a aSepChar$ separated list of object instantiations
FUNCTION getEOF()

Get the end of file status

Returns A boolean that is set to TRUE (1) when end of data stream has been reached.
FUNCTION getHeaderInfo()

Get the build header information that was collected while reading the file.

Returns A reference to [ProvideX Class:header_entity].
FUNCTION getKeywords$()

Get a (space-separated) list of keywords used on the current program line

Returns A list of keywords
FUNCTION getKeywords$(aPgmLine$)

Get a (space-separated) list of keywords used on the current program line

ParameterDescription
aPgmLine$ The program line to use (NULL value will use current program line)
Returns A list of keywords
FUNCTION getKeywords$(aPgmLine$, aSepChar$)

Get a (aSepChar$ separated) list of keywords used on the current program line

ParameterDescription
aPgmLine$ The program line to use (NULL value will use current program line)
aSepChar$ The character to use to separate each member of the list; if not set will default to a space.
Returns A list of keywords
FUNCTION getKeywordsPlus$()

Get a (space-separated) list of keywords,mnemonics,labels used on the current program line

Returns A list of keywords, mnemonics, and labels
FUNCTION getKeywordsPlus$(aPgmLine$)

Get a (space-separated) list of keywords,mnemonics,labels used on the current program line

ParameterDescription
aPgmLine$ The program line to use (NULL value will use current program line)
Returns A list of keywords, mnemonics, and labels
FUNCTION getKeywordsPlus$(aPgmLine$, aSepChar$)

Get a (aSpeChar$ separated) list of keywords,mnemonics,labels used on the current program line

ParameterDescription
aPgmLine$ The program line to use (NULL value will use current program line)
aSepChar$ The character to use to separate each member of the list; if not set will default to a space.
Returns A list of keywords, mnemonics, and labels
FUNCTION getLiterals$()

Get a (SEP separated) list of literals used on the current program line

Returns A list of literals
FUNCTION getLiterals$(aPgmLine$)

Get a (SEP separated) list of literals used on the current program line

ParameterDescription
aPgmLine$ The program line to use (NULL value will use current program line)
Returns A list of literals
FUNCTION getMnemonics$()

Get a (space-separated) list of mnemonics used on the current program line

Returns A list of mnemonics
FUNCTION getMnemonics$(aPgmLine$)

Get a (space-separated) list of mnemonics used on the current program line

ParameterDescription
aPgmLine$ The program line to use (NULL value will use current program line)
Returns A list of mnemonics
FUNCTION getMnemonics$(aPgmLine$, aSepChar$)

Get a (aSepChar$ separated) list of mnemonics used on the current program line

ParameterDescription
aPgmLine$ The program line to use (NULL value will use current program line)
aSepChar$ The character to use to separate each member of the list; if not set will default to a space.
Returns A list of mnemonics
FUNCTION getRemarks$()

Get remarks for the current program line

Returns A the remarks
FUNCTION getRemarks$(aPgmLine$)

Get remarks for the current program line

ParameterDescription
aPgmLine$ The program line to use (NULL value will use current program line)
Returns A the remarks
FUNCTION getRemarks$(aPgmLine$, aSepChar$)

Get remarks for the current program line

ParameterDescription
aPgmLine$ The program line to use (NULL value will use current program line)
aSepChar$ The character to use to separate each member of the list; if not set will default to a space.
Returns A the remarks
FUNCTION getSourceFileType()

Get the type of source file

Returns A code to indicate the type of file for the program
Program File type
ValueDescription
1 A text file
2 A tokenized program file
FUNCTION getSourceText$()

Get the text as read from source file for current program line. The keywords may be changed based on the setting of the 'changeKeywords' property.

Returns A string containing the text from the source file with minimal processing.
If the source file is not a text file, this method will return an error 13.
FUNCTION getStatementLabels$()

Get a (space-separated) list of statement labels used on the current program line

Returns A list of labels
FUNCTION getStatementLabels$(aPgmLine$)

Get a (space-separated) list of statement labels used on the current program line

ParameterDescription
aPgmLine$ The program line to use (NULL value will use current program line)
Returns A list of labels
FUNCTION getStatementLabels$(aPgmLine$, aSepChar$)

Get a (aSepChar$ separated) list of statement labels used on the current program line

ParameterDescription
aPgmLine$ The program line to use (NULL value will use current program line)
aSepChar$ The character to use to separate each member of the list; if not set will default to a space.
Returns A list of labels
FUNCTION getVariables$()

Get a (space-separated) list of variables referenced on the current program line

Returns A list of variables
FUNCTION getVariables$(aPgmLine$)

Get a (space-separated) list of variables referenced on the specified program line

ParameterDescription
aPgmLine$ The program line to use (NULL value will use current program line)
Returns A list of variables
FUNCTION getVariables$(aPgmLine$, aSepChar$)

Get a list of variables referenced on the specified program line

ParameterDescription
aPgmLine$ The program line to use (NULL value will use current program line)
aSepChar$ The character to use to separate each member of the list; if not set will default to a space.
Returns A list of variables
FUNCTION hasLineNumbers()

The source file has line numbers. This value is based on the first line in the file since the program load will fail if the remainder of the source file does not use line numbers.

Returns A simple boolean value (0=False, 1=True)
FUNCTION read$()

Read the next program line from the data stream.

Returns A string containing the text that was retrieved
FUNCTION setBlockCommentsVisible(inBoolean)

Set a flag to control whether C-style block comments are returned to the controlling application. The default is to hide these comments.

ParameterDescription
inBoolean (0=False, 1=True)
FUNCTION setChangeKeywords(useConversion)

Set the conversion rule to be used for replacing keywords in the source text when requested.

ParameterDescription
useConversion The type of conversion applied to the keywords
Conversion rules for keywords
ValueDescription
0 No change (default)
1 Force keywords to uppercase
2 Force keywords to lowercase
3 Use substitution table for keyword replacement (FUTURE)
FUNCTION setConvertLineLabels(doConvert)

Enable/Disable conversion of line labels as part of keyword conversion process

ParameterDescription
doConvert Boolean value to enable/disable conversion of line labels
FUNCTION setIgnoreIncludes(inBoolean)

Set a flag to disable processing of '#include' references

ParameterDescription
inBoolean (0=False, 1=True)
FUNCTION setStripLineNumbers(inBoolean)

Set a flag to strip the line number from program line

ParameterDescription
inBoolean (0=False, 1=True)
FUNCTION setStripPvxDocTagInfo(inBoolean)

Set a flag to Enable/Disable the stripping of the document tag information

ParameterDescription
inBoolean (0=False, 1=True)