-
- All Superinterfaces:
java.lang.CharSequence
public interface Input extends java.lang.CharSequence
An input has a string builder and also a file name from where the input is coming from. The string builder is used to fetch the characters. The reference file name is used to construct the name of the files in case a macro likeimport
orinclude
needs to open another file.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Input
append(java.lang.Object obj)
default char
charAt(int index)
default Input
delete(int start, int end)
int
getColumn()
int
getLine()
Position
getPosition()
java.lang.String
getReference()
java.lang.StringBuilder
getSB()
Get theStringBuilder
that contains the characters of the input.default int
indexOf(java.lang.String str)
default int
length()
default void
reset()
void
stepColumn()
Step the column number by one.void
stepLine()
Step the line number by one and reset the column number to 1.default java.lang.CharSequence
subSequence(int start, int end)
default java.lang.String
substring(int start)
default java.lang.String
substring(int start, int end)
-
-
-
Method Detail
-
getSB
java.lang.StringBuilder getSB()
Get theStringBuilder
that contains the characters of the input. The processing many times works directly on theStringBuilder
deleting characters from the start of it as the processing progresses, thus essentially modifying/mutating theInput
object.- Returns:
- the
StringBuilder
containing the characters of the input.
-
getPosition
Position getPosition()
- Returns:
- the line reference that contains the line number and also the filename
-
getReference
java.lang.String getReference()
- Returns:
- the reference file name that the input was read from
-
getLine
int getLine()
- Returns:
- the current line number of the file where the input currently is in
-
getColumn
int getColumn()
- Returns:
- the current column of the the line where the input currently is in
-
stepLine
void stepLine()
Step the line number by one and reset the column number to 1.
-
stepColumn
void stepColumn()
Step the column number by one.
-
length
default int length()
- Specified by:
length
in interfacejava.lang.CharSequence
-
charAt
default char charAt(int index)
- Specified by:
charAt
in interfacejava.lang.CharSequence
-
delete
default Input delete(int start, int end)
-
subSequence
default java.lang.CharSequence subSequence(int start, int end)
- Specified by:
subSequence
in interfacejava.lang.CharSequence
-
append
default Input append(java.lang.Object obj)
-
reset
default void reset()
-
indexOf
default int indexOf(java.lang.String str)
-
substring
default java.lang.String substring(int start, int end)
-
substring
default java.lang.String substring(int start)
-
-