org.opencores.verilogp
Class VTokenizer

java.lang.Object
  |
  +--java.io.StreamTokenizer
        |
        +--org.opencores.verilogp.VTokenizer

class VTokenizer
extends java.io.StreamTokenizer

Implements Verilog suitable tokenizer.

See Also:
StreamTokenizer

Field Summary
(package private) static int AND
          defines character with the same name
(package private) static int BSLASH
          defines character with the same name
(package private) static int COLON
          defines character with the same name
(package private) static int COMMA
          defines character with the same name
(package private) static int DOT
          defines character with the same name
(package private) static int EOF
          defines character with the same name
(package private) static int EQUAL
          defines character with the same name
(package private) static int LBRACKET
          defines character with the same name
(package private) static int LCBRACKET
          defines character with the same name
(package private) static int LPAREN
          defines character with the same name
 int nbits
          Number of bits last number read hold.
(package private) static int NOT
          defines character with the same name
(package private) static int NUMBER
          defines character with the same name
(package private) static int OR
          defines character with the same name
(package private) static int RBRACKET
          defines character with the same name
(package private) static int RCBRACKET
          defines character with the same name
(package private) static int RPAREN
          defines character with the same name
(package private) static int SEMI
          defines character with the same name
(package private) static int XOR
          defines character with the same name
 
Fields inherited from class java.io.StreamTokenizer
buf, CT_ALPHA, CT_COMMENT, CT_DIGIT, CT_QUOTE, CT_WHITESPACE, ctype, eolIsSignificantP, forceLower, input, LINENO, nval, peekc, pushedBack, reader, slashSlashCommentsP, slashStarCommentsP, sval, TT_EOF, TT_EOL, TT_NOTHING, TT_NUMBER, TT_WORD, ttype
 
Constructor Summary
(package private) VTokenizer(java.io.Reader reader)
          constructs new Verilog tokenizer
 
Method Summary
 int nextToken()
          Gets next token extended.
private  int parseNumber(java.lang.String s)
          Parses String for binary, octal, decimal or hex number.
private  void setTable()
          setup lexer table
 
Methods inherited from class java.io.StreamTokenizer
commentChar, eolIsSignificant, lineno, lowerCaseMode, ordinaryChar, ordinaryChars, parseNumbers, pushBack, quoteChar, read, resetSyntax, slashSlashComments, slashStarComments, toString, whitespaceChars, wordChars
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

nbits

public int nbits
Number of bits last number read hold.

EOF

static final int EOF
defines character with the same name

NUMBER

static final int NUMBER
defines character with the same name

LPAREN

static final int LPAREN
defines character with the same name

RPAREN

static final int RPAREN
defines character with the same name

COMMA

static final int COMMA
defines character with the same name

COLON

static final int COLON
defines character with the same name

DOT

static final int DOT
defines character with the same name

SEMI

static final int SEMI
defines character with the same name

LBRACKET

static final int LBRACKET
defines character with the same name

RBRACKET

static final int RBRACKET
defines character with the same name

NOT

static final int NOT
defines character with the same name

AND

static final int AND
defines character with the same name

OR

static final int OR
defines character with the same name

XOR

static final int XOR
defines character with the same name

EQUAL

static final int EQUAL
defines character with the same name

BSLASH

static final int BSLASH
defines character with the same name

LCBRACKET

static final int LCBRACKET
defines character with the same name

RCBRACKET

static final int RCBRACKET
defines character with the same name
Constructor Detail

VTokenizer

VTokenizer(java.io.Reader reader)
constructs new Verilog tokenizer
Parameters:
reader - file reader to read from
Method Detail

nextToken

public int nextToken()
              throws java.io.IOException
Gets next token extended. WARNING: '-' shouldn't be pushed back.
Overrides:
nextToken in class java.io.StreamTokenizer

setTable

private void setTable()
setup lexer table

parseNumber

private int parseNumber(java.lang.String s)
Parses String for binary, octal, decimal or hex number. Number of bits required to store number is placed into nbits
Parameters:
s - String to parse
Returns:
number