Class Parser


  • public class Parser
    extends java.lang.Object
    EDS parsing algorithm yielding a condensed, uncommented form in memory.
    • Constructor Summary

      Constructors 
      Constructor Description
      Parser()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String escapeForEDS​(java.lang.String v)
      Render a generic unicode string in a form suitable for inclusion in a quoted string in an EDS file.
      static boolean isKeywordChar​(char c)  
      static boolean isSectionNameChar​(char c, char prior)  
      static boolean isWhiteSpace​(char c)  
      static void main​(java.lang.String[] args)  
      static DataSheet parse​(java.io.InputStream source)  
      • 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

      • escapeForEDS

        public static java.lang.String escapeForEDS​(java.lang.String v)
        Render a generic unicode string in a form suitable for inclusion in a quoted string in an EDS file. Only 16-bit code points are supported in the CIP specification. The predefined escapes are those listed in Volume 1, ยง7-3.5.1.1.8 (v3.26). Printable characters in the Latin-1 subset (0x20-0x7e, 0xa1-0xac, 0xae-0xff) are passed through unchanged. All other 8-bit values not associated with a predefined short escape will be escaped with \x and two hexadecimal characters. All higher codes will be escaped with \\u and four hexadecimal characters.
        Parameters:
        v - The string to escape
        Returns:
        The Latin-1 compatible escaped string.
      • isWhiteSpace

        public static boolean isWhiteSpace​(char c)
      • isKeywordChar

        public static boolean isKeywordChar​(char c)
      • isSectionNameChar

        public static boolean isSectionNameChar​(char c,
                                                char prior)
      • parse

        public static DataSheet parse​(java.io.InputStream source)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • main

        public static void main​(java.lang.String[] args)
                         throws java.io.IOException
        Throws:
        java.io.IOException