Class Jcoder


  • class Jcoder
    extends java.lang.Object
    Compiles just 1 source file
    • Field Detail

      • Classes

        private java.util.ArrayList<ByteBuffer> Classes
      • bufstream

        private java.io.DataOutputStream bufstream
      • depth

        private int depth
      • tabStr

        private java.lang.String tabStr
      • scanner

        protected Scanner scanner
      • fileSeparator

        private static char fileSeparator
    • Constructor Detail

      • Jcoder

        Jcoder​(SourceFile sf,
               java.util.HashMap<java.lang.String,​java.lang.String> macros)
        throws java.io.IOException
        Create a parser
        Throws:
        java.io.IOException
    • Method Detail

      • expect

        private void expect​(JcodTokens.Token t)
                     throws SyntaxError,
                            java.io.IOException
        Expect a token, return its value, scan the next token or throw an exception.
        Throws:
        SyntaxError
        java.io.IOException
      • recoverField

        private void recoverField()
                           throws SyntaxError,
                                  java.io.IOException
        Throws:
        SyntaxError
        java.io.IOException
      • parseArray

        private void parseArray()
                         throws java.io.IOException
        Parse an array of struct.
        Throws:
        java.io.IOException
      • parseByteArray

        private void parseByteArray()
                             throws java.io.IOException
        Parse a byte array.
        Throws:
        java.io.IOException
      • parseAttr

        private void parseAttr()
                        throws java.io.IOException
        Parse an Attribute.
        Throws:
        java.io.IOException
      • parseComp

        private void parseComp()
                        throws java.io.IOException
        Parse a Component of JavaCard .cap file.
        Throws:
        java.io.IOException
      • adjustDepth

        private void adjustDepth​(boolean up)
      • parseStruct

        private int parseStruct()
                         throws java.io.IOException
        Parse a structure.
        Throws:
        java.io.IOException
      • recoverFile

        private void recoverFile()
                          throws java.io.IOException
        Recover after a syntax error in the file. This involves discarding tokens until an EOF or a possible legal continuation is encountered.
        Throws:
        java.io.IOException
      • parseModule

        private void parseModule()
                          throws java.io.IOException
        Parse module declaration
        Throws:
        java.io.IOException
      • parseClass

        private void parseClass​(JcodTokens.Token prev)
                         throws java.io.IOException
        Parse a class or interface declaration.
        Throws:
        java.io.IOException
      • parseClause

        private void parseClause()
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • parseFile

        void parseFile()
        Parse an Jcoder file.
      • write

        public void write​(ByteBuffer cls,
                          java.io.File destdir)
                   throws java.io.IOException
        write to the directory passed with -d option
        Throws:
        java.io.IOException
      • write

        public void write​(java.io.File destdir)
                   throws java.io.IOException
        Writes the classes
        Throws:
        java.io.IOException