ebnf

Z80 ASM BNF structure… am I on the right track?

為{幸葍}努か 提交于 2019-11-27 01:59:45
I'm trying to learn BNF and attempting to assemble some Z80 ASM code. Since I'm new to both fields, my question is, am I even on the right track? I am trying to write the format of Z80 ASM as EBNF so that I can then figure out where to go from there to create machine code from the source. At the moment I have the following: Assignment = Identifier, ":" ; Instruction = Opcode, [ Operand ], [ Operand ] ; Operand = Identifier | Something* ; Something* = "(" , Identifier, ")" ; Identifier = Alpha, { Numeric | Alpha } ; Opcode = Alpha, Alpha ; Int = [ "-" ], Numeric, { Numeric } ; Alpha = "A" | "B"

Converting EBNF to BNF

岁酱吖の 提交于 2019-11-26 19:46:50
问题 It's been a few years since my computer-language class and so I've forgotten the finer points of BNF's and EBNF's and I don't have a textbook next to me. Specifically, I've forgotten how to convert an EBNF into BNF. From what little I remember, I know that one of the main points is to convert { term } into <term> | <many-terms> . But I don't remember the other rules. I've tried to look this up online but I can only find links to either homework questions, or a small comment about converting

How to convert BNF to EBNF

醉酒当歌 提交于 2019-11-26 12:31:54
问题 How can I convert this BNF to EBNF? <vardec> ::= var <vardeclist>; <vardeclist> ::= <varandtype> {;<varandtype>} <varandtype> ::= <ident> {,<ident>} : <typespec> <ident> ::= <letter> {<idchar>} <idchar> ::= <letter> | <digit> | _ 回答1: EBNF or Extended Backus-Naur Form is ISO 14977:1996, and is available in PDF from ISO for free * . It is not widely used by the computer language standards. There's also a paper that describes it, and that paper contains this table summarizing EBNF notation.

Z80 ASM BNF structure… am I on the right track?

痞子三分冷 提交于 2019-11-26 09:51:45
问题 I\'m trying to learn BNF and attempting to assemble some Z80 ASM code. Since I\'m new to both fields, my question is, am I even on the right track? I am trying to write the format of Z80 ASM as EBNF so that I can then figure out where to go from there to create machine code from the source. At the moment I have the following: Assignment = Identifier, \":\" ; Instruction = Opcode, [ Operand ], [ Operand ] ; Operand = Identifier | Something* ; Something* = \"(\" , Identifier, \")\" ; Identifier