• Keine Ergebnisse gefunden

MicroJava – Grammatik Program = "program" ident

N/A
N/A
Protected

Academic year: 2022

Aktie "MicroJava – Grammatik Program = "program" ident"

Copied!
1
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

MicroJava – Grammatik

Program = "program" ident { ConstDecl | VarDecl | ClassDecl }

"{" {MethodDecl} "}".

ConstDecl = "final" Type ident "=" ( number | charConst ) ";".

VarDecl = Type ident { "," ident } ";".

ClassDecl = "class" ident "{" { VarDecl } "}".

MethodDecl = ( Type | "void" ) ident "(" [ FormPars ] ")"

{ VarDecl } Block.

FormPars = Type ident { "," Type ident }.

Type = ident [ "[" "]" ].

Block = "{" { Statement } "}".

Statement = Designator ( Assignop Expr | ActPars | "++" | "--" ) ";"

| "if" "(" Condition ")" Statement [ "else" Statement ]

| "while" "(" Condition ")" Statement

| "break" ";"

| "return" [ Expr ] ";"

| "read" "(" Designator ")" ";"

| "print" "(" Expr [ "," number ] ")" ";"

| Block

| ";".

Assignop = "=" | "+=" | "-=" | "*=" | "/=" | "%=".

ActPars = "(" [ Expr { "," Expr } ] ")".

Condition = CondTerm { "||" CondTerm }.

CondTerm = CondFact { "&&" CondFact }.

CondFact = Expr Relop Expr.

Relop = "==" | "!=" | ">" | ">=" | "<" | "<=".

Expr = [ "–" ] Term { Addop Term }.

Term = Factor { Mulop Factor }.

Factor = Designator [ ActPars ]

| number

| charConst

| "new" ident [ "[" Expr "]" ]

| "(" Expr ")".

Designator = ident { "." ident | "[" Expr "]" }.

Addop = "+" | "–".

Mulop = "*" | "/" | "%" | "**" | "\/".

Referenzen

ÄHNLICHE DOKUMENTE

In addition to rules for reasoning about Hoare triples, Hoare logic needs a base logic to reason about assertions, e.g. That is, strictly speaking, FOL formulas are part of

8.3 Formalization and soundness of the Hoare logic 8.4 Program verification with Isabelle/HOL.. 8.5 Verifying procedural, heap-manipulating programs 8.6 Software

[r]

Control words from the calling program specify the data channel to be sampled, meter function (type of measurement), meter mode (measurement or calibration check),

The HP Program Catalog is presented to you as a reference to all Assembly, FORTRAN and ALGOL programs cur- rently available from the Hewlett-Packard Software

In addition, a file may be bypassed during the running of the program under sense switch control (SSe). A continuous field up to 30 characters in length may be

In converting the operands to an output data stream, numerous checking and utility functions are performed such as computing, checking and translating Set Buffer

These four functions are (1) data migration, which moves less active data sets off primary volumes, (2) recall, which moves migrated data sets back to primary volumes,