Browsable Java Virtual Machine (JVM) Grammar

CC-BY

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

Summary

Syntax

PrimitiveTypeDescriptor ::=
	[boolean]::ε
	[char]::ε
	[byte]::ε
	[short]::ε
	[int]::ε
	[float]::ε
	[long]::ε
	[double]::ε
TypeDescriptor ::=
	[primitive]::[type]::PrimitiveTypeDescriptor
	[object]::[internalName]::string
	[array]::[type]::TypeDescriptor
MethodDescription ::=
	[methodDescriptor]::([arguments]::TypeDescriptor* [returnType]::TypeDescriptor)
TypeSignature ::=
	[primitive]::[type]::PrimitiveTypeDescriptor
	[fieldType]::[sig]::FieldTypeSignature
FieldTypeSignature ::=
	[classType]::[class]::ClassTypeSignature
	[array]::[type]::TypeSignature
	[typeVar]::[name]::string
ClassTypeSignature ::=
	[topLevel]::([internalName]::string [args]::TypeArg*)
	[inner]::([class]::ClassTypeSignature [name]::string [args]::TypeArg*)
TypeArg ::=
	[type]::[fieldType]::FieldTypeSignature
	[wildcard]::ε
	[extends]::[fieldType]::FieldTypeSignature
	[super]::[fieldType]::FieldTypeSignature
Class ::=
	[class]::([version]::integer [modifiers]::ClassModifier* [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 [modifiers]::ClassModifier* [name]::string [signature]::string [superName]::string [interfaces]::string* [innerClasses]::InnerClass* [fields]::Field* [methods]::Method*)
AccessModifier ::=
	[public]::ε
	[private]::ε
	[protected]::ε
ClassModifier ::=
	[access]::[access]::AccessModifier
	[final]::ε
	[super]::ε
	[interface]::ε
	[abstract]::ε
	[synthetic]::ε
	[annotation]::ε
	[enum]::ε
	[deprecated]::ε
InnerClass ::=
	[innerClass]::([name]::string [outerName]::string [innerName]::string [modifiers]::ClassModifier*)
	[innerClass]::([name]::string [modifiers]::ClassModifier*)
Field ::=
	[field]::([modifiers]::FieldModifier* [name]::string [description]::string [signature]::string [value]::α)
	[field]::([modifiers]::FieldModifier* [name]::string [description]::string [signature]::string)
FieldModifier ::=
	[access]::[access]::AccessModifier
	[static]::ε
	[final]::ε
	[volatile]::ε
	[transient]::ε
	[synthetic]::ε
	[enum]::ε
Method ::=
	[method]::([modifiers]::MethodModifier* [name]::string [description]::string [signature]::string [exceptions]::string* [instructions]::Instruction* [tryCatchBlocks]::TryCatchBlock* [localVariables]::LocalVariable*)
MethodModifier ::=
	[access]::[access]::AccessModifier
	[static]::ε
	[final]::ε
	[synchronized]::ε
	[bridge]::ε
	[varags]::ε
	[native]::ε
	[abstract]::ε
	[strict]::ε
	[synthetic]::ε
Instruction ::=
	[getStatic]::([owner]::string [name]::string [description]::string)
	[putStatic]::([owner]::string [name]::string [description]::string)
	[getField]::([owner]::string [name]::string [description]::string)
	[putField]::([owner]::string [name]::string [description]::string)
	[increment]::([index]::integer [amount]::integer)
	[nop]::ε
	[aConstNull]::ε
	[iConstM1]::ε
	[iConst0]::ε
	[iConst1]::ε
	[iConst2]::ε
	[iConst3]::ε
	[iConst4]::ε
	[iConst5]::ε
	[lConst0]::ε
	[lConst1]::ε
	[fConst0]::ε
	[fConst1]::ε
	[fConst2]::ε
	[dConst0]::ε
	[dConst1]::ε
	[iaLoad]::ε
	[laLoad]::ε
	[faLoad]::ε
	[daLoad]::ε
	[aaLoad]::ε
	[baLoad]::ε
	[caLoad]::ε
	[saLoad]::ε
	[iaStore]::ε
	[laStore]::ε
	[faStore]::ε
	[daStore]::ε
	[aaStore]::ε
	[baStore]::ε
	[caStore]::ε
	[saStore]::ε
	[pop]::ε
	[pop2]::ε
	[dup]::ε
	[dupX1]::ε
	[dupX2]::ε
	[dup2]::ε
	[dup2X1]::ε
	[dup2X2]::ε
	[swap]::ε
	[iAdd]::ε
	[lAdd]::ε
	[fAdd]::ε
	[dAdd]::ε
	[iSub]::ε
	[lSub]::ε
	[fSub]::ε
	[dSub]::ε
	[iMul]::ε
	[lMul]::ε
	[fMul]::ε
	[dMul]::ε
	[iDiv]::ε
	[lDiv]::ε
	[fDiv]::ε
	[dDiv]::ε
	[iRem]::ε
	[lRem]::ε
	[fRem]::ε
	[dRem]::ε
	[iNeg]::ε
	[lNeg]::ε
	[fNeg]::ε
	[dNeg]::ε
	[iShl]::ε
	[lShl]::ε
	[iShr]::ε
	[lShr]::ε
	[iuShr]::ε
	[luShr]::ε
	[iAnd]::ε
	[lAnd]::ε
	[iOr]::ε
	[lOr]::ε
	[iXor]::ε
	[lXor]::ε
	[i2l]::ε
	[i2f]::ε
	[i2d]::ε
	[l2i]::ε
	[l2f]::ε
	[l2d]::ε
	[f2i]::ε
	[f2l]::ε
	[f2d]::ε
	[d2i]::ε
	[d2l]::ε
	[d2f]::ε
	[i2b]::ε
	[i2c]::ε
	[i2s]::ε
	[lCmp]::ε
	[fCmpL]::ε
	[fCmpG]::ε
	[dCmpL]::ε
	[dCmpH]::ε
	[iReturn]::ε
	[lReturn]::ε
	[fReturn]::ε
	[dReturn]::ε
	[aReturn]::ε
	[return]::ε
	[arrayLength]::ε
	[aThrow]::ε
	[monitorEnter]::ε
	[monitorExit]::ε
	[biPush]::[operand]::integer
	[siPush]::[operand]::integer
	[newArray]::[operand]::integer
	[ifEq]::[label]::integer
	[ifNe]::[label]::integer
	[ifLt]::[label]::integer
	[ifGe]::[label]::integer
	[ifGt]::[label]::integer
	[ifLe]::[label]::integer
	[ifICmpEq]::[label]::integer
	[ifICmpNe]::[label]::integer
	[ifICmpLt]::[label]::integer
	[ifICmpGe]::[label]::integer
	[ifICmpGt]::[label]::integer
	[ifICmpLe]::[label]::integer
	[ifACmpEq]::[label]::integer
	[ifACmpNe]::[label]::integer
	[goto]::[label]::integer
	[jsr]::[label]::integer
	[ifNull]::[label]::integer
	[ifNonNull]::[label]::integer
	[label]::[index]::integer
	[lineNumber]::([line]::integer [labelIndex]::integer)
	[localVariable]::([opcode]::integer [index]::integer)
	[iLoad]::[index]::integer
	[lLoad]::[index]::integer
	[fLoad]::[index]::integer
	[dLoad]::[index]::integer
	[aLoad]::[index]::integer
	[iStore]::[index]::integer
	[lStore]::[index]::integer
	[fStore]::[index]::integer
	[dStore]::[index]::integer
	[aStore]::[index]::integer
	[ret]::[index]::integer
	[ldcString]::[string]::string
	[ldcInt]::[int]::integer
	[ldcLong]::[long]::integer
	[ldcFloat]::[float]::integer
	[ldcDouble]::[double]::integer
	[lookupSwitch]::([defaultLabel]::integer [keys]::integer* [cases]::integer*)
	[invokeVirtual]::([owner]::string [name]::string [description]::string)
	[invokeSpecial]::([owner]::string [name]::string [description]::string)
	[invokeStatic]::([owner]::string [name]::string [description]::string)
	[invokeInterface]::([owner]::string [name]::string [description]::string)
	[invokeDynamic]::([owner]::string [name]::string [description]::string)
	[multiANewArray]::([description]::string [dimensions]::integer)
	[tableSwitch]::([min]::integer [max]::integer [defaultLabel]::integer [cases]::integer*)
	[new]::[internalName]::string
	[aNewArray]::[internalName]::string
	[checkCast]::[internalName]::string
	[instanceOf]::[internalName]::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. []