Interface Compiler

  • All Superinterfaces:
    Plugin
    All Known Implementing Classes:
    AbstractCompiler

    public interface Compiler
    extends Plugin
    Compiler plugin root interface.

    Should be implemented by a plugin. There should exist just one implementation.

    Compiler can define a "compiler context", which can specify e.g. a format of compiled file, or other additional meta-information for runtime, which can be used by other plugins.

    See Also:
    CompilerContext
    • Method Detail

      • addCompilerListener

        void addCompilerListener​(CompilerListener listener)
        Adds CompilerListener object into list of listeners. If some event is occurred in the compiler, listeners methods will be called.
        Parameters:
        listener - CompilerListener object
      • removeCompilerListener

        void removeCompilerListener​(CompilerListener listener)
        Removes CompilerListener object from the listeners list.
        Parameters:
        listener - CompilerListener object
      • compile

        boolean compile​(java.lang.String inputFileName,
                        java.lang.String outputFileName)
        Compile an input file into the output file.
        Parameters:
        inputFileName - name of the input file (source code)
        outputFileName - name of the output file (compiled code)
        Returns:
        true if compile was successful, false otherwise
      • compile

        boolean compile​(java.lang.String inputFileName)
        Compile an input file into the output file.

        Output file name is derived by the compiler itself. Usually, the extension of the input file is replaced by another one, denoting compiled file. It is compiler-specific.

        Parameters:
        inputFileName - name of the input file (source code)
        Returns:
        true if compile was successful, false otherwise
      • createLexer

        LexicalAnalyzer createLexer()
        Creates a lexical analyzer.
        Returns:
        new lexer object
      • getSourceFileExtensions

        java.util.List<FileExtension> getSourceFileExtensions()
        Get the list of source file extensions supported by the compiler.
        Returns:
        list of supported source file extensions
      • isAutomationSupported

        default boolean isAutomationSupported()
        Description copied from interface: Plugin
        Determines if this plugin supports emulation automation
        Specified by:
        isAutomationSupported in interface Plugin
        Returns:
        true if the plugin supports emulation automation; false otherwise