Module cpclib_asm::parser
source · [−]Expand description
All the stuff to parse z80 code.
Modules
Structs
The self-referencing struct.
Context information that can guide the parser TODO add assembling flags
Enums
Add span information for a Token. This hierarchy is a mirror of the original token one
State to limit the parsing abilities depending on the parsing context
Traits
Implement this trait for type previousy defined without source location.
Trait to handle the span of listing elements
Functions
Parse operation related to + - & |
Generate a string from a parsing error. Probably deprecated
Parse an expression
Get a factor
TODO replace ALL expr parse by a located version
nom many0 does not seem to fit our parser requirements
Read a parenthesed expression
Parse ADC and ADD instructions
TODO Find a way to not duplicate code with complete version
Parse an address access (expression)
Parse the single opcode assembling function
TODO
Parse the instruction to hide basic lines
parse functions with two arguments
Parse a breakpint instruction
TODO reduce the flag space for jr“],
Parse a comment that start by ; and ends at the end of the line.
Parse if expression.TODO finish the implementation in order to have ELSEIF and ELSE branches“ TODO shorten the string code source
Parse a repetition counter
Parse CP tokens
Parse a sub-listing part that aims at being crunched after being assembled at first pass
Parse DB DW directives
Parse defs instruction. TODO add optional parameters
Parse any directive
Parse the duration function
TODO - currently consume several lines. Should do it only one time
Parse ex af, af’ instruction
Parse ex hl, de instruction
Parse ex (sp), hl
Parse an expression and returns it inside a DataAccession::Expression
TODO - limit the listing possibilities
Parse (HL)
Parse the IM instruction
Parse all the in flavors
Parse for the various binary include directives
Parser for the include directive
Parse and indexed register in 8bits
Parse a 16 bits indexed register
Parse (ix) and (iy)
Parse the use of an indexed register as (IX + 5)“
Parse a label(label: S) TODO reimplement to never build a string
Parse fake and real LD instructions
Parse artifical LD instruction (would be replaced by several real instructions)
Parse the valids LD versions
TODO
Manage the call of a macro. When ambiguou may return a label
Parse directives with no arguments
Parse any opcode having no argument
Parse standard org directive
TODO manage other out formats
Parse (C) used in in/out
Parse (nn) used in in/out
Parse (R16)
Parse any standard 16bits register TODO rename to emphasize it is standard reigsters
Parse any standard 16bits register TODO rename to emphasize it is standard reigsters
Parse register $char
Parse the $char register and return it as a DataAccess
Parse register $char
Parse the $char register and return it as a DataAccess
Parse register $char
Parse register $char
Parse the $char register and return it as a DataAccess
Parse register $char
Parse register $char
Parse the $char register and return it as a DataAccess
Parse register i
Parse the IX register
Parse register $reg
Parse register $reg
Parse the IY register
Parse register $reg
Parse register $reg
Parse register $char
Parse register r
Parse the $char register and return it as a DataAccess
Parse RES, SET and BIT instructions
Parse return from a function
TODO
Parse the rst instruction
Parse both save directive and write direct in a file
Par se the SBC instruction
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 tickin directives
Parse begining of ticker
Parse end of ticker
Parser for file names in appropriate directives
Substraction with A register
Parse the switch directive
Parse the opcodes. TODO rename as parse_opcode …
parse functions with one argument
Parse UNDEF directive.
Read a value
TODO
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 a single line of Z80. Code useing directive on several lines cannot work
Parse a line (ie a set of components separated by :) until the end of the line or a stop directive TODO add an argument o manage cases like ‘… : ENDIF’
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. TODO this complete piece of code MUST be removed and integrated within parse_z80_line_complete
TODO better to build parse_z80_str_with_context from parse_z80_span than the opposite
Parse a string and return the corresponding listing
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
Usefull later for db
TODO
Compute operations related to * % /
Parser for functions taking into argument a token