Current section
Files
Jump to
Current section
Files
lib/common/string_elements.ex
defmodule Common.StringElements do
@moduledoc """
Handles all the strings generated in the compilation process.
"""
# Compiler general name modules
@doc """
This method is called each time the compiler needs to print the output of the `Reader` module, specifically this method: `Reader.read_code_and_tokens/3`.
## Specs
Returns ```SCS``` which is just a label that represents the Source Code String and represents the source code of the C input program.
"""
def scs(), do: "SCS" # Source Code String
@doc """
This method is called each time the compiler needs to print the output of the `Reader` module, specifically this method: `Reader.read_code_and_tokens/3`.
## Specs
Returns ```GTL``` which is just a label that represents the General Token List and contains all the tokens contained in c_tokens.xml specification file.
"""
def gtl(), do: "GTL" # General Token List
@doc """
This method is called each time the compiler needs to print the output of the `Lexer` module, specifically this method: `Lexer.tokenize/1`.
## Specs
Returns ```OTL``` which is just a label that represents the Output Token List and contains all the tokens contained in the source code
"""
def otl(), do: "OTL" # Output Token List
@doc """
This method is called each time the compiler needs to print the output of the `CodeGenerator` module, specifically this method: `CodeGenerator.generate_code/2`.
## Specs
Returns ```Code generated``` which is just a label that represents the generated assembly code.
"""
def code_generated(), do: "Code generated"
@doc """
This method is called each time the compiler needs to print the output of the `CodeOptimizer` module, specifically this method: `CodeOptimizer.optimize/2`
## Specs
Returns ```Code optimized``` which is just a label that represents the optimized assembly code.
"""
def code_optimized(), do: "Code optimized"
@doc """
This method is called each time the compiler needs to print the output of the `CodeConnector` module, specifically this method: `CodeConnector.connect/2`.
## Specs
Returns ```Code connected``` which is just a label that represents the optimized assembly code with the appropiate headers needed to write the executable.
"""
def code_connected(), do: "Code connected"
@doc """
This method is called each time the compiler needs to print the output of the `Parser` module, specifically this method: `Parser.parse/2`.
## Specs
Returns ```OAST``` which is just a label that represents the Output Abstract Syntax Tree generated by the `Parser`.
"""
def oast(), do: "OAST" # Output Abstract Syntax Tree
# Output file names
@doc """
This method is called inside `Writer.write_file/1` and is the default ouput executable name.
If no output name is provided, `ExC` will use this one.
## Specs
Returns ```ouput.o.s``` which is the default output executable name.
"""
def asm_generated_file(), do: "output.o.s"
#General tests strings
def lexer_error_invalid_token(), do: "Lexer error: invalid token"
def parser_error_missing_token(), do: "Parser error: missing token"
def parser_error_token_not_absorbed(), do: "Parser error: token not absorbed"
end