Mini Java Compiler (IV)

Source: Internet
Author: User
Tags definition class definition
Compiling four, p code instructions
Because the system is simpler, the underlying hardware is simplified:

1, there is no register, only one data stack

2, only the main memory for storage, access operations

3, only support main memory indirect addressing

4, you can find symbols in the table symbol, return the symbolic address




Instruction sheet (not completed)
Mnemonics



Format



Description



Push

Push <address>

Pushes <address> points to content

Pop

Pop <address>

To bounce the top of the stack into <address> point position

jmp

JMP <address>

Unconditional jump to <address> point to code

Jt

JT <address> <goal>

Jump to <goal> point to code if <address> point to is true




V. Error information table
(defined in the Compiler.exception.ErrorMessage interface)





Analyzing_failure



File cannot be parsed



class_defined



Repeating class definition

class_not_defined



Class is not defined

identifier_defined



Duplicate identifier definition

identifier_not_defined



Identifier Not defined

Illegal_expression



An illegal expression

Illegal_grammer



Syntax error

Illegal_operation



Illegal operation

Illegal_token



Identifier cannot parse

method_defined



Duplicate method definition

not_allocated



Memory Not allocated

Out_of_memory



Memory is full

Read_file



File cannot be read

Type_unmatched



Type mismatch


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.