Module parser

Module parser 

Source
Expand description

All the stuff to parse z80 code.

Modules§

error_code

Structs§

LocatedListing
The self-referencing struct.
LocatedToken
Add span information for a Token.
ParserContext
Context information that can guide the parser TODO add assembling flags
ParserContextBuilder
ParserOptions
UnescapedString
Z80ParserError
Z80Span

Enums§

BreakPointArgument
DbDwStr
ExportKind
LocatedAssemblerControlCommand
LocatedDataAccess
LocatedExpr
LocatedMacroParam
LocatedTestKind
LocatedTokenInner
ParsingState
State to limit the parsing abilities depending on the parsing context
RunEnt
SaveKind
Z80ParserErrorKind

Statics§

END_DIRECTIVE_ORGAMS
STAND_ALONE_DIRECTIVE_ORGAMS
START_DIRECTIVE_ORGAMS

Traits§

Locate
Implement this trait for type previousy defined without source location.
MayHaveSpan
Trait to handle the span of listing elements
ParseToken
ParsingStateVerified
SourceString

Functions§

comp
Parse operation related to + - & |
expr2
Parse an expression
expr_list
inner_code
inner_code_with_state
Workaround because many0 is not used in the main root function TODO add an argument to handle context change
located_expr
TODO replace ALL expr parse by a located version
my_escaped
my_many0_nocollect
my_many_till_nocollect
my_repeat1
my_space0
Handle \ in end of line
my_space1
Handle \ in end of line
negative_number
number
one_instruction_inner_code
parens
Read a parenthesed expression
parse_add_or_adc
Parse ADC and ADD instructions
parse_address
Parse an address access (expression)
parse_align
parse_any_function_call
parse_argname_and_value
parse_argname_to_assign
parse_assemble
Parse the single opcode assembling function
parse_assembler_control
parse_assembler_control_max_passes_number
parse_assembler_control_print_any_pass
parse_assembler_control_print_parse
parse_assert
parse_assign_operator
parse_bank
parse_bankset
parse_basic
TODO
parse_basic_hide_lines
Parse the instruction to hide basic lines
parse_binary_function_call
parse functions with two arguments
parse_bool_expr
parse_breakpoint
Parse a breakpoint instruction
parse_breakpoint_access_value
parse_breakpoint_argument
parse_breakpoint_run_value
parse_breakpoint_type_value
parse_buildsna
parse_call_jp_or_jr
TODO reduce the flag space for jr“],
parse_charset
parse_charset_start_stop_end
parse_charset_string
parse_comment
Parse a comment that start by ; and ends at the end of the line.
parse_conditional
Parse if expression.TODO finish the implementation in order to have ELSEIF and ELSE branches“ TODO shorten the string code source
parse_confined
parse_convertible_word
parse_counter
Parse a repetition counter
parse_cp
Parse CP tokens
parse_crunched_section
Parse a sub-listing part that aims at being crunched after being assembled at first pass
parse_db_or_dw_or_str
Parse DB DW directives
parse_defs
Parse defs instruction. TODO add optional parameters
parse_directive
Parse any directive
parse_directive_new
Here local_parsing_state only serves to adapt DB/DW/STR behavior in struct. Maybe it should be used to control the directives of interest BEFORE there parsing instead of after. No filtering is done
parse_djnz
parse_duration
Parse the duration function
parse_end_directive
parse_ex_af
Parse ex af, af’ instruction
parse_ex_hl_de
Parse ex hl, de instruction
parse_ex_mem_sp
Parse ex (sp), hl
parse_export
parse_expr
Parse an expression and returns it inside a DataAccession::Expression
parse_expr_bracketed_list
parse_factor
Get a factor
parse_fail
parse_flag_test
parse_flag_value_inner
parse_fname
Accept “fname” as in most assemblers and fname as in vasm
parse_for
parse_forbidden_keyword
parse_function
parse_function_listing
TODO - limit the listing possibilities
parse_hl_address
Parse (HL)
parse_im
Parse the IM instruction
parse_in
Parse all the in flavors
parse_inc_dec
parse_incbin
Parse for the various binary include directives
parse_include
Parser for the include directive
parse_indexregister8
Parse and indexed register in 8bits
parse_indexregister16
Parse a 16 bits indexed register
parse_indexregister_address
Parse (ix) and (iy)
parse_indexregister_with_index
Parse the use of an indexed register as (IX + 5)“
parse_iterate
parse_label
Parse a label(label: S) TODO reimplement to never build a string
parse_labelprefix
parse_ld
Parse fake and real LD instructions
parse_ld_fake
Parse artifical LD instruction (would be replaced by several real instructions)
parse_ld_normal
Parse the valids LD versions
parse_limit
parse_line
Parse a line (ie a set of components separated by :) until the end of the line or a stop directive XXX: In opposite to the other functions, the result is stored in the parameter (to avoid unnecessary memory allocations and copies)
parse_line_component
parse_line_component_standard
Optionally return a label and a command next token is a separator :, \n, eof
parse_line_or_with_comment
TODO - currently consume several lines. Should do it only one time
parse_lines
parse_logical_operator
parse_macro
TODO
parse_macro_arg
parse_macro_name
parse_macro_or_struct_call
TODO remove by restore the way to parse the macro name
parse_macro_or_struct_call_inner
Manage the call of a macro.
parse_map
parse_module
parse_multiline_comment
parse_nop
parse_opcode_no_arg
Parse any opcode having no argument
parse_optional_argname_and_value
parse_org
Parse standard org directive
parse_orgams_expression
parse_orgams_factor
parse_orgams_fail
parse_orgams_operator
parse_orgams_ordered_expression
parse_orgams_repeat
parse_out
TODO manage other out formats
parse_portc
Parse (C) used in in/out
parse_portnn
Parse (nn) used in in/out
parse_print
parse_print_inner
parse_protect
parse_push_n_pop
parse_range
parse_reg_address
Parse (R16)
parse_register8
Parse any standard 16bits register TODO rename to emphasize it is standard reigsters
parse_register16
Parse any standard 16bits register TODO rename to emphasize it is standard reigsters
parse_register_a
Parse register $char
parse_register_af
Parse the $char register and return it as a DataAccess
parse_register_b
Parse register $char
parse_register_bc
Parse the $char register and return it as a DataAccess
parse_register_c
Parse register $char
parse_register_d
Parse register $char
parse_register_de
Parse the $char register and return it as a DataAccess
parse_register_e
Parse register $char
parse_register_h
Parse register $char
parse_register_hl
Parse the $char register and return it as a DataAccess
parse_register_i
Parse register i
parse_register_ix
Parse the IX register
parse_register_ixh
Parse register $reg
parse_register_ixl
Parse register $reg
parse_register_iy
Parse the IY register
parse_register_iyh
Parse register $reg
parse_register_iyl
Parse register $reg
parse_register_l
Parse register $char
parse_register_r
Parse register r
parse_register_sp
Parse the $char register and return it as a DataAccess
parse_repeat
parse_res_set_bit
Parse RES, SET and BIT instructions
parse_ret
parse_return
parse_rorg
TODO
parse_rst
Parse the rst instruction
parse_rst_fake
parse_run
parse_save
Parse both save directive and write direct in a file
parse_sbc
Par se the SBC instruction
parse_section
parse_shifts_and_rotations
Parse all RLC, RL, RR, SLA, SRA flavors RLC A RLC B RLC C RLC D RLC E RLC H RLC L RLC (HL) RLC (IX+n) RLC (IY+n)
parse_shifts_and_rotations_fake
parse_single_token
parse_skip
parse_stable_ticker
Parse tickin directives
parse_stable_ticker_start
Parse begining of ticker
parse_stable_ticker_stop
Parse end of ticker
parse_startingindex
parse_string
Parser for file names in appropriate directives
parse_stringlike_without_quote
parse_struct_directive
parse_sub
Substraction with A register
parse_switch
Parse the switch directive
parse_token
parse_token1
parse_token2
parse_unary_function_call
parse functions with one argument
parse_undef
Parse UNDEF directive.
parse_value
Read a value
parse_waitnops
parse_while
TODO
parse_write_direct_memory
parse write direct in memory / converted to a bank directive we do not care of the parameters for roms as we are not working in an emulator
parse_z80
TODO better to build parse_z80_with_options from parse_z80_span than the opposite
parse_z80_directive_with_block
parse_z80_line_complete
parse_z80_str
Parse a string and return the corresponding listing
parse_z80_with_context_builder
Produce the stream of tokens. In case of error, return an explanatory string. In case of success loop over all the tokens in order to expand those that read files
positive_number
prefixed_label_expr
shift
string_expr
TODO
term
Compute operations related to * % /
token_function
Parser for functions taking into argument a token

Type Aliases§

InnerLocatedListing
InnerZ80Span