IRISLIB database
SyntaxColorReader Class Reference
Inheritance diagram for SyntaxColorReader:
Collaboration diagram for SyntaxColorReader:

Public Member Functions

_.Library.Boolean AtEndGet ()
 
_.Library.Status ForgetNotedPosition ()
 
_.Library.String GetInfoLine ()
 Return the info line, if any. More...
 
_.Library.Boolean NextErrorInfo (_.Library.String Description, _.Library.String Source, _.Library.String Location, _.Library.Integer LineNumber, _.Library.Integer LineOffset)
 Return the next error info. More...
 
_.Library.Boolean NextLine (_.Library.List LineCSV, _.Library.Boolean ColoringErrors, _.Library.Boolean ColoringWarnings)
 
_.Library.Status NotePosition ()
 
_.Library.Status RestoreNotedPosition ()
 
_.Library.Status Rewind ()
 
 SkipLines (_.Library.Integer N)
 
- Public Member Functions inherited from RegisteredObject
_.Library.Status OnAddToSaveSet (_.Library.Integer depth, _.Library.Integer insert, _.Library.Integer callcount)
 This callback method is invoked when the current object is added to the SaveSet,. More...
 
_.Library.Status OnClose ()
 This callback method is invoked by the <METHOD>Close</METHOD> method to. More...
 
_.Library.Status OnConstructClone (_.Library.RegisteredObject object, _.Library.Boolean deep, _.Library.String cloned)
 This callback method is invoked by the <METHOD>ConstructClone</METHOD> method to. More...
 
_.Library.Status OnNew ()
 This callback method is invoked by the <METHOD>New</METHOD> method to. More...
 
_.Library.Status OnValidateObject ()
 This callback method is invoked by the <METHOD>ValidateObject</METHOD> method to. More...
 

Static Public Member Functions

_.Library.Status FromCode (_.Stream.Object Code, _.Library.String Language, _.Library.String ExtraFlags, _.Library.SyntaxColorReader Reader, _.Library.Boolean AnyColoringErrors, _.Library.Boolean AnyColoringWarnings, _.Library.String Symbols, _.Library.Boolean BufferStream)
 

Private Member Functions

_.Library.Status OnNew (_.Stream.Object CSV, _.Library.Boolean BufferStream)
 

Private Attributes

 __AtEnd
   More...
 
 __BufferedStream
 This is here so that we can give better error messages. More...
 
 __CSV
   More...
 
 __ErrorInfo
 Not valid until AtEnd. More...
 
 __InfoLine
 Not valid until AtEnd. More...
 
 __PositionIsNoted
   More...
 
 __RewoundErrorInfo
 Whether or not we've rewound ErrorInfo. More...
 

Additional Inherited Members

- Static Public Attributes inherited from RegisteredObject
 CAPTION = None
 Optional name used by the Form Wizard for a class when generating forms. More...
 
 JAVATYPE = None
 The Java type to be used when exported.
 
 PROPERTYVALIDATION = None
 This parameter controls the default validation behavior for the object. More...
 

Detailed Description

Front end for reading the CSV output from SyntaxColor:Color. Instead of reading the stream directly and reconstructing the lines you can use a SyntaxColorReader object and call its NextLine method.

To create a SyntaxColorReader object you can pass a CSV stream to New; alternatively you can call FromCode and it will call SyntaxColor for you.

Member Function Documentation

◆ OnNew()

_.Library.Status OnNew ( _.Stream.Object  CSV,
_.Library.Boolean  BufferStream 
)
private

Create a SyntaxColorReader over the given CSV stream

◆ AtEndGet()

_.Library.Boolean AtEndGet ( )

The AtEnd property can be used to check for the end of the reader over the CSV stream

◆ ForgetNotedPosition()

_.Library.Status ForgetNotedPosition ( )

Forget the noted position

◆ FromCode()

_.Library.Status FromCode ( _.Stream.Object  Code,
_.Library.String  Language,
_.Library.String  ExtraFlags,
_.Library.SyntaxColorReader  Reader,
_.Library.Boolean  AnyColoringErrors,
_.Library.Boolean  AnyColoringWarnings,
_.Library.String  Symbols,
_.Library.Boolean  BufferStream 
)
static

Given a code stream, language, optional extra flags and/or symbols string for SyntaxColor:Color

Return a SyntaxColorReader over the resulting CSV and whether there were any coloring errors/warnings (anywhere in the document)

◆ GetInfoLine()

_.Library.String GetInfoLine ( )

Return the info line, if any.

Not valid until AtEnd

◆ NextErrorInfo()

_.Library.Boolean NextErrorInfo ( _.Library.String  Description,
_.Library.String  Source,
_.Library.String  Location,
_.Library.Integer  LineNumber,
_.Library.Integer  LineOffset 
)

Return the next error info.

Not valid until AtEnd

◆ NextLine()

_.Library.Boolean NextLine ( _.Library.List  LineCSV,
_.Library.Boolean  ColoringErrors,
_.Library.Boolean  ColoringWarnings 
)

Return a structured list of coloring information about the current line of code represented by

the CSV stream, advancing the stream. In general, a number of lines will be read from the CSV stream to make up one logical line corresponding to a line of the original code. CSV lines of the form "\n" determine logical line boundaries.

If the stream is at its end this method returns 0, otherwise 1.

If 1 is returned the ByRef parameters are set up from the stream items which were read :-

  • LineCSV is set to a list of items, where each item is $LB(lang,terminal,code)
  • ColoringErrors and ColoringWarnings are set to whether there were any coloring errors/warnings at all on the line

◆ NotePosition()

_.Library.Status NotePosition ( )

Note the current stream position, caller must call

RestorePosition or ForgetPosition later.

◆ RestoreNotedPosition()

_.Library.Status RestoreNotedPosition ( )

Restore the noted position

◆ Rewind()

_.Library.Status Rewind ( )

Move back to the beginning of the stream

- not allowed if the position is noted

◆ SkipLines()

SkipLines ( _.Library.Integer  N)

Move forward N lines - stops if end of file found first (doesn't report any error)

Member Data Documentation

◆ __AtEnd

__AtEnd
private

 

 

◆ __BufferedStream

__BufferedStream
private

This is here so that we can give better error messages.

 

◆ __CSV

__CSV
private

 

 

◆ __ErrorInfo

__ErrorInfo
private

Not valid until AtEnd.

 

◆ __InfoLine

__InfoLine
private

Not valid until AtEnd.

 

◆ __PositionIsNoted

__PositionIsNoted
private

 

 

◆ __RewoundErrorInfo

__RewoundErrorInfo
private

Whether or not we've rewound ErrorInfo.