Class Parser


  • public class Parser
    extends java.lang.Object
    Parser implements a parser of integer, real and string literals.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Parser.SizeBase
      Parser.SizeBase encapsulates literal size/base information.
    • Constructor Summary

      Constructors 
      Constructor Description
      Parser()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static VerilogLiteral parseNumber​(java.lang.String text)
      Parses the string and constructs the literal object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Parser

        public Parser()
    • Method Detail

      • parseNumber

        public static VerilogLiteral parseNumber​(java.lang.String text)
        Parses the string and constructs the literal object.

        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' | '?'

        Parameters:
        text - the string to be parsed.
        Returns:
        the literal object.