Uncategorized

parsing and scanning Research Paper

parsing and scanning Research Paper

1 Introduction In the lectures and laboratory sessions we have introduced the concepts of scanning and parsing, further we have seen how to create a simple scanner and parser for the interpreted execution of basic mathematical expressions of the form 3+5*7. In this assignment, you are required to: 1. Produce a written report summarising the main features of scanners, parsers and to additionally discuss how the parsed structure can then be evaluated. 2. Document Preview: 1 Introduction In the lectures and laboratory sessions we have introduced the concepts of scanning and parsing, further we have seen how to create a simple scanner and parser for the interpreted execution of basic mathematical expressions of the form 3+5*7. In this assignment, you are required to: 1. Produce a written report summarising the main features of scanners, parsers and to additionally discuss how the parsed structure can then be evaluated. 2. Produce a scanner, parser and interpreter (evaluator) for a simple processors assembly language described in the next section. To pass you need to achieve a mark of 40% or greater. The mark scheme is outlined in this document. 2 Basic Problem Description: Simple Processor The simple processor has 32 32bit integer registers, labelled R0,R1,,R31 and 16 bits of addressable memory storage (32bits wide), this means that addresses 0 to 65535 are valid and a 32bit value can be stored at each location. The assembly language consists of operations such as LD R1, R2,0 which loads the contents of the memory address specified in R2+0 into R1. To clarify, if R2 contained the value 5 and at memory address 5, the value 27 was stored, then this would result in 27 being loaded into R1. If the operation was LD R1,R2,2 then the content of memory address 7 would be loaded into R1. Similarly ST R1,R2,0 will store the contents of R1 to the memory location that is the contents of R2+0, or if we had ST R1,R2,12 then the store location would become R2+12. The immediate number value should be limited to be a 17bit signed integer i.e values in the range +65535 down to -65536 can be represented. Arithmetic instructions will include MUL R2,R3,4: R2=R2*(R3+4), SUB R2,R3,6: R2 = R2-(R3+6 ), ADD R2,R3,5: R2 = R2 + R3 + 5, DIV R2,R3,5: R2 = R2 / (R3+5). Jump and branch instructions will include BNEZ R1, 5: if R1 is not equal to zero then PC = PC + 1 +5, BEZ R2, -4: if R2 is equal to zero then PC = PC +1 Attachments: soft.architec.docx

Is this the question you were looking for? If so, place your order here to get started!

×