[][src]Module cpclib_asm::parser

All the stuff to parse z80 code.

Modules

error_code

...

Structs

ParserContext

Context information that can guide the parser

Functions

bin_u16

Parse a binary number

comment

Parse a comment that start by ; and ends at the end of the line.

comp

Parse operation related to + - & |

dec_number

Parse an usigned 16 bit number

decode_parsing_error

Generate a string from a parsing error. Probably deprecated

expr

Parse an expression

expr_list

...

factor

Get a factor

hex_number

Read an hexadecimal value

inner_hex

Read an hexidecimal value

my_many0

nom many0 does not seem to fit our parser requirements

parens

Read a parenthesed expression

parse_add_or_adc

...

parse_add_or_adc_complete

Parse ADC and ADD instructions

parse_add_or_adc_shorten

TODO Find a way to not duplicate code with complete version

parse_address

Parse an address access (expression)

parse_align

...

parse_assemble

Parse the single opcode assembling function

parse_assert

...

parse_basic

TODO

parse_basic_hide_lines

Parse the instruction to hide basic lines

parse_binary_functions

parse functions with two arguments

parse_breakpoint

Parse a breakpint instruction

parse_call_jp_or_jr

TODO reduce the flag space for jr"],

parse_conditional

Parse if expression.TODO finish the implementation in order to have ELSEIF and ELSE branches"

parse_cp

Parse CP tokens

parse_db_or_dw

Parse DB DW directives

parse_defs

Parse defs instruction. TODO add optional parameters

parse_directive

Parse any directive

parse_djnz

...

parse_duration

Parse the duration function

parse_empty_line

TODO - currently consume several lines. Should do it only one time

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_expr

Parse an expression and returns it inside a DataAccession::Expression

parse_flag_test

...

parse_fname

Parser for file names in appropriate directives

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_label

Parse a label(label: S)

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_logical_operator

...

parse_macro

TODO

parse_macro_call

Manage the call of a macro.

parse_noarg_directive

Parse directives with no arguments

parse_opcode_no_arg

Parse any opcode having no argument

parse_org

Parse standard org directive

parse_out

TODO manage other out formats

parse_portc

Parse (C) used in in/out

parse_print

...

parse_protect

...

parse_push_n_pop

...

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

TODO

parse_res_set_bit

Parse RES, SET and BIT instructions

parse_ret

...

parse_rorg

TODO

parse_rst

Parse the rst instruction

parse_sbc

Par se the SBC instruction

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_stable_ticker

Parse tickin directives

parse_stable_ticker_start

Parse begining of ticker

parse_stable_ticker_stop

Parse end of ticker

parse_str

Parse a string and return the corresponding listing

parse_str_with_context

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

parse_sub

Substraction with A register

parse_token

Parse the opcodes. TODO rename as parse_opcode ...

parse_unary_functions

parse functions with one argument

parse_undef

Parse UNDEF directive.

parse_value

Read a value

parse_z80_code

Parse a complete code

parse_z80_str

For an unknwon reason, the parse_z80_code function fails when there is no comment... // Mainly used for test This one is a workaround as still as the other is not fixed

parse_z80_line

Parse a single line of Z80. Code useing directive on several lines cannot work

parse_z80_line_complete

Parse a line TODO add an argument o manage cases like '... : ENDIF'

parse_z80_line_label_only

No opcodes are expected there. Initially it was supposed to manage lines with only labels, however it has been extended to labels fallowed by specific commands.

string_between_quotes

Usefull later for db

string_expr

TODO

term

Compute operations related to * % /

token_function

Parser for functions taking into argument a token