0% found this document useful (0 votes)
72 views1 page

Mini Java

The document summarizes the grammar of MiniJava, which includes rules for programs, declarations, statements, expressions, conditions, operators, and more. A program consists of declarations followed by statements. Declarations define types and names of variables. Statements include blocks, assignments, input/output, conditionals, and loops. Expressions can be numbers, names, operations on expressions, and conditionals check expressions.

Uploaded by

Houssem Nasri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views1 page

Mini Java

The document summarizes the grammar of MiniJava, which includes rules for programs, declarations, statements, expressions, conditions, operators, and more. A program consists of declarations followed by statements. Declarations define types and names of variables. Statements include blocks, assignments, input/output, conditionals, and loops. Expressions can be numbers, names, operations on expressions, and conditionals check expressions.

Uploaded by

Houssem Nasri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

TECHNISCHE UNIVERSITÄT MÜNCHEN

FAKULTÄT FÜR INFORMATIK


Lehrstuhl für Sprachen und Beschreibungsstrukturen WS 11/12
Einführung in die Informatik I 2. Merkblatt
Prof. Dr. Helmut Seidl, M. Schwarz, A. Herz, Dr. M. Petter 27.10.2010

Die Grammatik von MiniJava (aus der Vorlesung):

<program> ::= <decl>* <stmt>*

<decl> ::= <type> <name> (, <name> )* ;

<type> ::= int

<stmt> ::= ;
| { <stmt>* }
| <name> = <expr>;
| <name> = read();
| write(<expr>);
| if (<cond>) <stmt>
| if (<cond>) <stmt> else <stmt>
| while (<cond>) <stmt>

<expr> ::= <number>


| <name>
| (<expr>)
| <unop> <expr>
| <expr> <binop> <expr>

<unop> ::= -

<binop> ::= - | + | * | / | %

<cond> ::= true


| false
| ( <cond> )
| <expr> <comp> <expr>
| <bunop> <cond>
| <cond> <bbinop> <cond>

<comp> ::= == | != | <= | < | >= | >

<bunop> ::= !

<bbinop> ::= && | ||

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy