Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Decaf Reference Grammar: Java-like Programming Language, Study Guides, Projects, Research of Computer Science

The revised draft of the decaf programming language reference grammar. It covers the structure of a decaf program, classes, declarations, methods, blocks, statements, expressions, and operators.

Typology: Study Guides, Projects, Research

Pre 2010

Uploaded on 08/09/2009

koofers-user-big
koofers-user-big ๐Ÿ‡บ๐Ÿ‡ธ

10 documents

1 / 2

Toggle sidebar

Related documents


Partial preview of the text

Download Decaf Reference Grammar: Java-like Programming Language and more Study Guides, Projects, Research Computer Science in PDF only on Docsity! Decaf Reference Grammar Draft โ€“ Revised 2/28/08 After left factoring, <program> ๏ƒ  class <class-name> โ€˜{โ€˜ <declarations> โ€˜}โ€™ <class-name> ๏ƒ  id <declarations> ๏ƒ  ๏ฅ | <type> id <declarations-cont1> | void id โ€˜(โ€˜ [ { <type> id }+, ] โ€˜)โ€™ <block> <method-declarations> <declarations-cont1> ๏ƒ  โ€˜=โ€™ <constant> โ€˜;โ€™ <declarations> | โ€˜;โ€™ <declarations> | โ€˜,โ€™ <id-list> โ€˜;โ€™ <declarations> | โ€˜(โ€˜ [ { <type> id }+, ] โ€˜)โ€™ <block> <method-declarations> <id-list> ๏ƒ  id | id โ€˜,โ€™ <id-list> <method-declarations> ๏ƒ  ๏ฅ | <type> id โ€˜(โ€˜ [ { <type> id }+, ] โ€˜)โ€™ <block> <method-declarations> | void id โ€˜(โ€˜ [ { <type> id }+, ] โ€˜)โ€™ <block> <method-declarations> <block> ๏ƒ  โ€˜{โ€˜ <var-decl> * <statement> * โ€˜}โ€™ <var-decl> ๏ƒ  <type> { id } +, โ€˜;โ€™ <type> ๏ƒ  int | bool <statement> ๏ƒ  id <statement-cont> | callout โ€˜(โ€˜ stringConstant [ { <callout-arg> } +, } ] โ€˜)โ€™ | if โ€˜(โ€˜ <expr> โ€˜)โ€™ <block> | while โ€˜(โ€˜ <expr> โ€˜)โ€™ <block> | for โ€˜(โ€˜ { <assign> } +, โ€˜;โ€™ <expr> โ€˜;โ€™ { <assign> } +, โ€˜)โ€™ <block> // remover for? | return [ <expr> ] โ€˜;โ€™ | break โ€˜;โ€™ | continue โ€˜;โ€™ | <block> <statement-cont> ๏ƒ  โ€˜=โ€™ <expr> โ€˜;โ€™ // assign | <array-index-part> โ€˜=โ€™ <expr> โ€˜;โ€™ // assign | <method-param-part> โ€˜;โ€™ // method call
Docsity logo



Copyright ยฉ 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved