Browsable Jess 1.0 Grammar

CC-BY

Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: §wip/atl/Jess/extracted
Source used for this grammar: Guillaume Doux, Jess 1.0, Jess.ecore, 2008/04/08

Summary

Syntax

LocatedElement ::=
	Root
LocatedElement ::=
	Expression
LocatedElement ::=
	SlotOp
LocatedElement ::=
	VarDefinition
LocatedElement ::=
	DeclareRule
LocatedElement ::=
	DeclareVar
LocatedElement ::=
	DeclareBloc
LocatedElement ::=
	ASlotDef
LocatedElement ::=
	SlotOptions
LocatedElement ::=
	ConditionAction
LocatedElement ::=
	ElifConditionAction
Root ::=
	[expressions]::Expression+
Expression ::=
	Integ
Expression ::=
	Floa
Expression ::=
	Str
Expression ::=
	Ident
Expression ::=
	TemplateExpression
Expression ::=
	DefinitionExp
Expression ::=
	UseFuncExp
Integ ::=
	[val]::Integer
Floa ::=
	[val]::Double
Str ::=
	[val]::String
Ident ::=
	ValidIdentifier
Ident ::=
	SlotName
Ident ::=
	JessVariable
ValidIdentifier ::=
	[val]::String
SlotName ::=
	[val]::String
JessVariable ::=
	[val]::String
TemplateExpression ::=
	[templateName]::ValidIdentifier [firstSlot]::SlotOp [slotOp]::SlotOp+
SlotOp ::=
	[slotIdent]::SlotName [operator]::ValidIdentifier [exp]::Expression
DefinitionExp ::=
	GlobalDefinition
DefinitionExp ::=
	FunctionDefinition
DefinitionExp ::=
	AdviceDefinition
DefinitionExp ::=
	UnDefAdvice
DefinitionExp ::=
	FactDefinition
DefinitionExp ::=
	RuleDefinition
DefinitionExp ::=
	ModuleDefinition
DefinitionExp ::=
	QueryDefinition
DefinitionExp ::=
	TemplateDefinition
GlobalDefinition ::=
	[varDef]::VarDefinition+
VarDefinition ::=
	[jessVar]::JessVariable [eq]::ValidIdentifier [expression]::Expression
FunctionDefinition ::=
	[funcName]::ValidIdentifier [parameters]::JessVariable+ [expressions]::Expression+
AdviceDefinition ::=
	[direction]::Advice [op]::Ident [advice]::Expression+
UnDefAdvice ::=
	[op]::Expression
FactDefinition ::=
	[factName]::ValidIdentifier [documentation]::Str [fact]::Expression+
RuleDefinition ::=
	[ruleName]::ValidIdentifier [documentation]::Str [declare]::DeclareRule [conditions]::Expression+ [functionCall]::UseFuncExp+
DeclareRule ::=
	[salience]::Expression [nodeIndexHash]::Expression [autoFocus]::ValidIdentifier [noLoop]::ValidIdentifier
ModuleDefinition ::=
	[moduleName]::ValidIdentifier [documentation]::Str
QueryDefinition ::=
	[queryName]::ValidIdentifier [documentation]::Str [declare]::DeclareVar [expressions]::Expression+
DeclareVar ::=
	[var]::JessVariable+ [node]::Expression [max]::Expression
TemplateDefinition ::=
	[templateName]::ValidIdentifier [inherits]::ValidIdentifier+ [documentation]::Str [declareBloc]::DeclareBloc [slotDef]::ASlotDef+
DeclareBloc ::=
	[slotSpecific]::ValidIdentifier [backchainReaction]::ValidIdentifier [fromClass]::ValidIdentifier [includeVariable]::ValidIdentifier [order]::ValidIdentifier
ASlotDef ::=
	SlotDef
ASlotDef ::=
	MultiSlotDef
ASlotDef ::=
	[slotName]::SlotName [optionals]::SlotOptions+
SlotDef ::=
	[slotName]::SlotName [optionals]::SlotOptions+
MultiSlotDef ::=
	[slotName]::SlotName [optionals]::SlotOptions+
SlotOptions ::=
	[type]::ValidIdentifier [def]::Expression [defaultDyn]::Expression [allowedValues]::Expression+
UseFuncExp ::=
	WhileExp
UseFuncExp ::=
	ForExp
UseFuncExp ::=
	ForeachExp
UseFuncExp ::=
	FuncCall
UseFuncExp ::=
	EngineExp
UseFuncExp ::=
	ExitExp
UseFuncExp ::=
	IfExpression
WhileExp ::=
	[hasDo]::Boolean [boolExp]::Expression [actions]::Expression+
ForExp ::=
	[initializer]::Expression [condition]::Expression [increment]::Expression [expressions]::Expression+
ForeachExp ::=
	[var]::JessVariable [list]::Expression [expressions]::Expression+
FuncCall ::=
	[funcName]::ValidIdentifier [funcParam]::Expression+
EngineExp ::=
	ε
ExitExp ::=
	ε
IfExpression ::=
	[ifthen]::ConditionAction [elifthen]::ElifConditionAction+ [else]::Expression+
ConditionAction ::=
	[condition]::Expression [actions]::Expression+
ElifConditionAction ::=
	[condAct]::ConditionAction
Advice ::=
	[before]::ε
	[after]::ε
Boolean ::=
	"true"
	"false"
Integer ::=
	integer
String ::=
	string

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