|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gov.nist.nlpir.irfapps.hci.BibToken
A class to represent a token in a TROFF Bibliographic (refer) Document.
| Field Summary | |
(package private) static int |
EOF
Token type value |
(package private) static int |
SEP
Token type value |
(package private) static int |
TAG
Token type value |
char |
tagname
field abbreviation |
int |
type
type of token |
(package private) static int |
UNDEF
Token type value |
java.lang.String |
value
value of token |
| Constructor Summary | |
BibToken(int t,
char name,
java.lang.String v)
Creates new biblio field token using the bibliography field abbreviation character. |
|
| Method Summary | |
(package private) static boolean |
isBlankLine(java.lang.String line)
Determines if supplied string contains only white space charaters. |
static BibToken |
readBibToken(java.io.PushbackReader f)
Scans a java PushbackReader of TROFF Bibliographic Documents until a token is recognized, then returns the token. |
void |
setToken(int t,
char name,
java.lang.String v)
Sets BibToken |
java.lang.String |
toString()
Returns a string representation of the BibToken object with the token type, tag name, and token value. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
static final int TAG
static final int UNDEF
static final int SEP
static final int EOF
public int type
public char tagname
public java.lang.String value
| Constructor Detail |
public BibToken(int t,
char name,
java.lang.String v)
t - id of TOKENname - bibliography field abbreviation character| Method Detail |
public void setToken(int t,
char name,
java.lang.String v)
t - id of TOKENbibliography - field abbreviation characterpublic java.lang.String toString()
static boolean isBlankLine(java.lang.String line)
line - string containing one line of text ending in a
newline
public static BibToken readBibToken(java.io.PushbackReader f)
throws java.io.IOException
PushbackReader - containing BIB DocumentsThe function is based on the grammar shown below.
lambda_ws -> lambda | WHITESPACE_NO_NL ; blankline -> NEWLINE lambda_ws NEWLINE ; eod -> blankline | eof ; HCIdocument -> recordlist eod ; recordlist -> lambda | record recordlist ; record -> tag content record -> title | section | author | bookname | date | pages | copyright | abstract ; title -> "%T" content ; section -> "%S" content ; author -> "%A" content ; bookname -> "%B" content ; date -> "%D" content ; pages -> "%P" content ; copyright -> "%C" content ; abstract -> "%X" content ; content -> STRING | STRING SPACE content ;terminals are in UPPERCASE
scanner finite state machine
state input output next state
-------------------------------------------------------
0 % 1
0 eof separator end
-------------------------------------------------------
1 A-Z setrectype 2
-------------------------------------------------------
2 space 3
-------------------------------------------------------
3 A-Za-z{punct, sp} 3
3 newline 4
3 eof newdoc,pushback end
-------------------------------------------------------
4 A-Za-z{punct, sp} 3
4 space 4
4 newline newdoc,pushback end
4 eof newdoc,pushback end
4 % newdoc,pushback end
-------------------------------------------------------
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||