Browsable Java Virtual Machine (JVM) Grammar

CC-BY

Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: java/jvm/level0/extracted
Source used for this grammar: Jeroen van den Bos, Jurgen Vinju, lang::jvm::ast::Level0, 2010–2012 [GitHub]

Summary

Syntax

Class ::=
	[class]::([version]::integer [access]::integer [name]::string [signature]::string [superName]::string [interfaces]::string* [sourceFile]::string [sourceDebug]::string [outerClass]::string [outerMethod]::string [outerMethodDescription]::string [innerClasses]::InnerClass* [fields]::Field* [methods]::Method*)
	[class]::([version]::integer [access]::integer [name]::string [signature]::string [superName]::string [interfaces]::string* [innerClasses]::InnerClass* [fields]::Field* [methods]::Method*)
InnerClass ::=
	[innerClass]::([name]::string [outerName]::string [innerName]::string [access]::integer)
	[innerClass]::([name]::string [access]::integer)
Field ::=
	[field]::([access]::integer [name]::string [description]::string [signature]::string [value]::α)
	[field]::([access]::integer [name]::string [description]::string [signature]::string)
Method ::=
	[method]::([access]::integer [name]::string [description]::string [signature]::string [exceptions]::string* [instructions]::Instruction* [tryCatchBlocks]::TryCatchBlock* [localVariables]::LocalVariable*)
Instruction ::=
	[fieldRef]::([opcode]::integer [owner]::string [name]::string [description]::string)
	[increment]::([index]::integer [amount]::integer)
	[instruction]::[opcode]::integer
	[integer]::([opcode]::integer [operand]::integer)
	[jump]::([opcode]::integer [labelIndex]::integer)
	[label]::[index]::integer
	[lineNumber]::([line]::integer [labelIndex]::integer)
	[localVariable]::([opcode]::integer [index]::integer)
	[loadConstantString]::[stringValue]::string
	[loadConstantInteger]::[integerValue]::integer
	[loadConstantLong]::[longValue]::integer
	[loadConstantFloat]::[floatValue]::integer
	[loadConstantDouble]::[doubleValue]::integer
	[lookupSwitch]::([defaultLabelIndex]::integer [keys]::integer* [cases]::integer*)
	[method]::([opcode]::integer [owner]::string [name]::string [description]::string)
	[multiANewArray]::([description]::string [dimensions]::integer)
	[tableSwitch]::([minIndex]::integer [maxIndex]::integer [defaultLabelIndex]::integer [cases]::integer*)
	[type]::([opcode]::integer [description]::string)
TryCatchBlock ::=
	[tryCatchBlock]::([startLabelIndex]::integer [endLabelIndex]::integer [handlerLabelIndex]::integer [type]::string)
	[finallyBlock]::([startLabelIndex]::integer [endLabelIndex]::integer [handlerLabelIndex]::integer)
LocalVariable ::=
	[localVariable]::([name]::string [description]::string [signature]::string [startLabelIndex]::integer [endLabelIndex]::integer [index]::integer)

GrammarLabMaintained by Dr. Vadim Zaytsev a.k.a. @grammarware. Last updated in September 2015. []