public class Parser
extends java.lang.Object
Parser
implements a parser of integer, real and string literals.Modifier and Type | Class and Description |
---|---|
static class |
Parser.SizeBase
Parser.SizeBase encapsulates literal size/base information. |
Constructor and Description |
---|
Parser() |
Modifier and Type | Method and Description |
---|---|
static VerilogLiteral |
parseNumber(java.lang.String text)
Parses the string and constructs the literal object.
|
public static VerilogLiteral parseNumber(java.lang.String text)
The number format is follows: NUMBER : ((SIZE)? BASE)? INTEGER (FRACTION)? (EXPONENT)? SIZE : (DIGIT)+ BASE : '\'' ('s' | 'S')? ('d' | 'h' | 'o' | 'b') INTEGER : DIGIT (DIGIT | '_')* FRACTION : '.' (DIGIT | '_')* EXPONENT : 'e' ('+'|'-')? (DIGIT)+ DIGIT : ('0'..'9') | ('a'..'f') | 'x' | 'z' | '?'
text
- the string to be parsed.