Class CBExpressionSource
java.lang.Object
com.io7m.cedarbridge.exprsrc.internal.CBExpressionSource
- All Implemented Interfaces:
CBExpressionLineLogType, CBExpressionSourceType, Closeable, AutoCloseable
The default expression source.
-
Constructor Summary
ConstructorsConstructorDescriptionCBExpressionSource(CBRecordingUnicodeCharacterReader inReader, URI inUri, InputStream inStream, com.io7m.jsx.api.parser.JSXParserType inParser) The default expression source. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()contextualize(com.io7m.jlexing.core.LexicalPosition<?> position) Show a contextually highlighted line for the given lexical position.Optional<com.io7m.jsx.SExpressionType> showLineFor(int lineNumber) Show the previously-encountered line with the given line number.source()
-
Constructor Details
-
CBExpressionSource
public CBExpressionSource(CBRecordingUnicodeCharacterReader inReader, URI inUri, InputStream inStream, com.io7m.jsx.api.parser.JSXParserType inParser) The default expression source.- Parameters:
inReader- A character readerinUri- The source URIinStream- The source streaminParser- The source parser
-
-
Method Details
-
source
- Specified by:
sourcein interfaceCBExpressionSourceType- Returns:
- The URI of the source
-
parseExpressionOrEOF
public Optional<com.io7m.jsx.SExpressionType> parseExpressionOrEOF() throws com.io7m.jsx.api.parser.JSXParserException, IOException- Specified by:
parseExpressionOrEOFin interfaceCBExpressionSourceType- Returns:
- The next expression, or
Optional.empty()if EOF is reached - Throws:
com.io7m.jsx.api.parser.JSXParserException- On parse errorsIOException- On I/O errors
-
showLineFor
Description copied from interface:CBExpressionLineLogTypeShow the previously-encountered line with the given line number.- Specified by:
showLineForin interfaceCBExpressionLineLogType- Parameters:
lineNumber- The line number- Returns:
- The line, if one has been encountered
-
contextualize
Description copied from interface:CBExpressionLineLogTypeShow a contextually highlighted line for the given lexical position.- Specified by:
contextualizein interfaceCBExpressionLineLogType- Parameters:
position- The position- Returns:
- The highlighted line, if one has been encountered
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-