Top Description Fields Constructors Methods
com.jogamp.gluegen.jcpp

public Class LexerSource

extends Source
Class Inheritance
Known Direct Subclasses
com.jogamp.gluegen.jcpp.StringLexerSource, com.jogamp.gluegen.jcpp.FileLexerSource, com.jogamp.gluegen.jcpp.InputLexerSource
Imports
java.io.IOException, .Reader, javax.annotation.Nonnull

Does not handle digraphs.

Field Summary

Modifier and TypeField and Description
private boolean
private int
private boolean
private static final boolean
private boolean
private boolean
private int
private int
private final boolean
private JoinReader
private int
private int
private int

Constructor Summary

AccessConstructor and Description
public
LexerSource(Reader r, boolean ppvalid)

Method Summary

Modifier and TypeMethod and Description
private void
_error(String msg, boolean error)

private String
_number_part(StringBuilder text, int base, boolean sign)

private Token
private Token
private Token
public void
close()

Overrides com.jogamp.gluegen.jcpp.Source.close.

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.
private Token
cond(char c, int yes, int no)

private Token
pack-priv final void
private int
public int
getColumn()

Overrides com.jogamp.gluegen.jcpp.Source.getColumn.

Returns the current column number within this Source.
public int
getLine()

Overrides com.jogamp.gluegen.jcpp.Source.getLine.

Returns the current line number within this Source.
private Token
identifier(int c)

pack-priv void
private Token
private static boolean
private static boolean
pack-priv boolean
isNumbered()

Overrides com.jogamp.gluegen.jcpp.Source.isNumbered.

Returns true if this source has line numbers.
private Token
number()

Section 6.4.4.1 of C99 (Not pasted here, but says that the initial negation is a separate token.) Section 6.4.4.2 of C99 A floating constant has a significand part that may be followed by an exponent part and a suffix that specifies its type.

private Token
private Token
number_hex(char x)

private int
read()

pack-priv void
setInclude(boolean b)

private Token
string(char open, char close)

public Token
token()

Implements abstract com.jogamp.gluegen.jcpp.Source.token.

Returns the next Token parsed from this input stream.
private void
unread(int c)

pack-priv final void
private Token
whitespace(int c)

Inherited from com.jogamp.gluegen.jcpp.Source:
errorgetNamegetParentgetPathisActiveisAutopopisExpandingiteratorsetActivesetListenersetParentskiplinewarning

Field Detail

bolback to summary
private boolean bol
columnback to summary
private int column
crback to summary
private boolean cr
DEBUGback to summary
private static final boolean DEBUG
digraphsback to summary
private boolean digraphs
includeback to summary
private boolean include
lastcolumnback to summary
private int lastcolumn
lineback to summary
private int line
ppvalidback to summary
private final boolean ppvalid
readerback to summary
private JoinReader reader
u0back to summary
private int u0
u1back to summary
private int u1
ucountback to summary
private int ucount

Constructor Detail

LexerSourceback to summary
public LexerSource(Reader r, boolean ppvalid)

Method Detail

_errorback to summary
private void _error(String msg, boolean error) throws LexerException
_number_partback to summary
private String _number_part(StringBuilder text, int base, boolean sign) throws IOException, LexerException
Annotations
@Nonnull
_number_suffixback to summary
private Token _number_suffix(StringBuilder text, NumericValue value, int d) throws IOException, LexerException
Annotations
@Nonnull
ccommentback to summary
private Token ccomment() throws IOException, LexerException
Annotations
@Nonnull
characterback to summary
private Token character() throws IOException, LexerException
Annotations
@Nonnull
closeback to summary
public void close() throws IOException

Overrides com.jogamp.gluegen.jcpp.Source.close.

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
condback to summary
private Token cond(char c, int yes, int no) throws IOException, LexerException
Annotations
@Nonnull
cppcommentback to summary
private Token cppcomment() throws IOException, LexerException
Annotations
@Nonnull
errorback to summary
pack-priv final void error(String msg) throws LexerException
escapeback to summary
private int escape(StringBuilder text) throws IOException, LexerException
getColumnback to summary
public int getColumn()

Overrides com.jogamp.gluegen.jcpp.Source.getColumn.

Doc from com.jogamp.gluegen.jcpp.Source.getColumn.

Returns the current column number within this Source.

Annotations
@Override
getLineback to summary
public int getLine()

Overrides com.jogamp.gluegen.jcpp.Source.getLine.

Doc from com.jogamp.gluegen.jcpp.Source.getLine.

Returns the current line number within this Source.

Annotations
@Override
identifierback to summary
private Token identifier(int c) throws IOException, LexerException
Annotations
@Nonnull
initback to summary
pack-priv void init(Preprocessor pp)

Overrides com.jogamp.gluegen.jcpp.Source.init.

Annotations
@Override
invalidback to summary
private Token invalid(StringBuilder text, String reason) throws IOException, LexerException
Annotations
@Nonnull
is_octalback to summary
private static boolean is_octal(String text)
isLineSeparatorback to summary
private static boolean isLineSeparator(int c)
isNumberedback to summary
pack-priv boolean isNumbered()

Overrides com.jogamp.gluegen.jcpp.Source.isNumbered.

Doc from com.jogamp.gluegen.jcpp.Source.isNumbered.

Returns true if this source has line numbers.

Annotations
@Override
numberback to summary
private Token number() throws IOException, LexerException

Section 6.4.4.1 of C99 (Not pasted here, but says that the initial negation is a separate token.) Section 6.4.4.2 of C99 A floating constant has a significand part that may be followed by an exponent part and a suffix that specifies its type. The components of the significand part may include a digit sequence representing the whole-number part, followed by a period (.), followed by a digit sequence representing the fraction part. The components of the exponent part are an e, E, p, or P followed by an exponent consisting of an optionally signed digit sequence. Either the whole-number part or the fraction part has to be present; for decimal floating constants, either the period or the exponent part has to be present. The significand part is interpreted as a (decimal or hexadecimal) rational number; the digit sequence in the exponent part is interpreted as a decimal integer. For decimal floating constants, the exponent indicates the power of 10 by which the significand part is to be scaled. For hexadecimal floating constants, the exponent indicates the power of 2 by which the significand part is to be scaled. For decimal floating constants, and also for hexadecimal floating constants when FLT_RADIX is not a power of 2, the result is either the nearest representable value, or the larger or smaller representable value immediately adjacent to the nearest representable value, chosen in an implementation-defined manner. For hexadecimal floating constants when FLT_RADIX is a power of 2, the result is correctly rounded.

Annotations
@Nonnull
number_decimalback to summary
private Token number_decimal() throws IOException, LexerException
Annotations
@Nonnull
number_hexback to summary
private Token number_hex(char x) throws IOException, LexerException
Annotations
@Nonnull
readback to summary
private int read() throws IOException, LexerException
setIncludeback to summary
pack-priv void setInclude(boolean b)
stringback to summary
private Token string(char open, char close) throws IOException, LexerException
Annotations
@Nonnull
tokenback to summary
public Token token() throws IOException, LexerException

Implements abstract com.jogamp.gluegen.jcpp.Source.token.

Doc from com.jogamp.gluegen.jcpp.Source.token.

Returns the next Token parsed from this input stream.

Annotations
@Override
unreadback to summary
private void unread(int c) throws IOException
warningback to summary
pack-priv final void warning(String msg) throws LexerException
whitespaceback to summary
private Token whitespace(int c) throws IOException, LexerException
Annotations
@Nonnull