Syntaxe Java Simplifiée (M403 - M404)

Introduction

Les diagrammes syntaxiques ci-après décrivent le sous-ensemble de la syntaxe du langage Java utilisé dans les module 403 et 404 pour le formation des informatiens à l’EPAI de Fribourg.

Les symboles non-terminaux des diagrammes sont cliquables de manière à faciliter la navigation.

Diagrammes syntaxiques

MainClassDefinition

public class App MainClassBody

no references

MainClassBody

{ GlobalConstantDefinition GlobalVariableDefinition ClassConstantDefinition ClassVariableDefinition MainProcedureDefinition ProcedureDefinition FunctionDefinition }

referenced by:

MainProcedureDefinition

private public static void main(String[] args) InstructionBlock

referenced by:

ClassDefinition

public class ClassName ClassBody

no references

ClassBody

{ GlobalConstantDefinition GlobalVariableDefinition ClassConstantDefinition ClassVariableDefinition ProcedureDefinition FunctionDefinition }

referenced by:

ClassConstantDefinition

private public static final Type ConstantName = ConstantExpression ;

referenced by:

ClassVariableDefinition

private public static Type VariableName = Expression ObjectCreation ArrayCreation ArrayInit ;

referenced by:

ClassMethodDefinition

private public static Type void MethodName ( FormalParams ) InstructionBlock

no references

FormalParams

final Type ParamName ,

referenced by:

LocalVariableDefinition

Type VariableName = Expression ObjectCreation ArrayCreation ArrayInit ;

referenced by:

Type

PrimitiveType ArrayType ClassType

referenced by:

PrimitiveType

byte short int long float double boolean char

referenced by:

ArrayType

Type []

referenced by:

ClassType

ClassName < ClassType >

referenced by:

ObjectCreation

new ClassName ( Expression )

referenced by:

ArrayCreation

new Type [ ConstantExpression ] [] []

referenced by:

ArrayInit

{ Expression ObjectCreation , }

referenced by:

Instruction

Assignment ProcedureInvocation ControlStructure

referenced by:

Assignement

VariableName = Expression ;

no references

ProcedureInvocation

ProcedureName ( Expression ) ;

referenced by:

ControlStructure

if-then-else switch while do-while for

referenced by:

if-then-else

if ( Expression ) InstructionBlock else InstructionBlock

referenced by:

switch

swich ( Expression ) CaseBlock

referenced by:

CaseBlock

{ case ConstantExpression : Instruction break; }

referenced by:

while

while ( Expression ) InstructionBlock

referenced by:

do-while

do InstructionBlock while ( Expression )

referenced by:

for

for ( LoopVariableInit ; LoopVariableTest ; LoopVariableInc ) InstructionBlock

referenced by:

LoopVariableInit

int LoopVariableName = 0

referenced by:

LoopVariableTest

LoopVariableName < Expression

referenced by:

LoopVariableInc

LoopVariableName += 1

referenced by:

LoopVariableName

i j k

referenced by:

InstructionBlock

{ LocalVariableDefinition Instruction }

referenced by:

Expression

VariableName ConstantName Literal FunctionApplication Operation ( Expression )

referenced by:

FunctionApplication

FunctionName ( Expression )

referenced by:

Operation

UnariOperator Expression BinaryOperator Expression

referenced by:

ConstantExpression

Literal ConstantName ConstantOperation

referenced by:

ConstantOperation

UnariOperator ConstantExpression BinaryOperator ConstantExpression

referenced by:

Literal

IntLiteral LongLiteral FloatLiteral DoubleLiteral BooleanLiteral StringLiteral

referenced by:

IntLiteral

- NonZeroDigit Digit 0

referenced by:

LongLiteral

- NonZeroDigit Digit 0 l L

referenced by:

FloatLiteral

IntLiteral . Digit e E + - Digit f F

referenced by:

DoubleLiteral

IntLiteral . Digit e E + - Digit d D

referenced by:

BooleanLiteral

true false

referenced by:

StringLiteral

" UnicodeChar "

referenced by:

ClassName

UpperCamelCaseIdentifier

referenced by:

VariableName

LowerCamelCaseIdentifier

referenced by:

ConstantName

UpperSnakeCaseIdentifier

referenced by:

ProcedureName

LowerCamelCaseIdentifier

referenced by:

FunctionName

LowerCamelCaseIdentifier

referenced by:

ParamName

LowerCamelCaseIdentifier

referenced by:

LowerCamelCaseIdentifier

LowerCaseChar UpperCamelCaseIdentifier

referenced by:

UpperCamelCaseIdentifier

UpperCaseChar UpperCaseChar LowerCaseChar

referenced by:

UpperSnakeCaseIdentifier

UpperCaseChar _

referenced by: