Class ApplesoftCompiler

  • All Implemented Interfaces:
    ApplesoftTokens

    public class ApplesoftCompiler
    extends java.lang.Object
    implements ApplesoftTokens
    Compile the given Applesoft file. The result will be an assembly program (ultimately assembled). This is not intended to be anything sophisticated.

    Date created: Nov 2, 2002 10:04:10 PM

    • Constructor Detail

      • ApplesoftCompiler

        public ApplesoftCompiler​(FileEntry fileEntry)
        Constructor for ApplesoftCompiler.
    • Method Detail

      • initializeKnownAddresses

        protected void initializeKnownAddresses()
        Load known memory addresses from AppleMemoryAddresses.properties.
      • hasMoreTokens

        protected boolean hasMoreTokens()
        Answers true if there are more tokens to process.
      • nextToken

        protected ApplesoftToken nextToken()
        Get the next token.
      • peekToken

        protected ApplesoftToken peekToken()
        Take a peek at the next token.
      • buildUsedAddresses

        protected java.lang.StringBuffer buildUsedAddresses()
        Build a list of ROM and Zero-page addresses that are used within this specific program.
      • buildVariableSection

        protected java.lang.StringBuffer buildVariableSection()
        Build the variable section that is placed at the end of the assembly listing.

        Warning: This method re-uses the global sourceAssembly variables since the addAssembly method is used to format the code.

      • evaluateCommand

        protected void evaluateCommand()
      • getMethod

        protected java.lang.reflect.Method getMethod​(ApplesoftToken token)
      • addAssembly

        protected void addAssembly​(java.lang.String label,
                                   java.lang.String mnemonic,
                                   java.lang.String parameter)
      • evaluateHOME

        public void evaluateHOME()
      • evaluateTEXT

        public void evaluateTEXT()
      • evaluateRETURN

        public void evaluateRETURN()
      • evaluateEND

        public void evaluateEND()
      • evaluateHGR

        public void evaluateHGR()
      • evaluateHGR2

        public void evaluateHGR2()
      • evaluateGR

        public void evaluateGR()
      • evaluateINVERSE

        public void evaluateINVERSE()
      • evaluateNORMAL

        public void evaluateNORMAL()
      • evaluateFLASH

        public void evaluateFLASH()
      • getLineNumberLabel

        protected java.lang.String getLineNumberLabel()
                                               throws CompileException
        Answer with the line number label. Used by GOTO and ON expr GOTO statements.
        Throws:
        CompileException
      • addLoadAddress

        protected void addLoadAddress​(Variable variable,
                                      char registerHi,
                                      char registerLo)
      • isIntegerNumber

        protected boolean isIntegerNumber​(java.lang.String value)
        Indicates if this string is a number.
      • isIntegerOnlyMath

        public boolean isIntegerOnlyMath()
        Indicates integer math only.
      • setIntegerOnlyMath

        public void setIntegerOnlyMath​(boolean integerOnlyMath)
        Sets integer only math.