Browsable FL Grammar

CC-BY

Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: toy/fl/concrete/rascal/extracted
Source used for this grammar: Vadim Zaytsev, Concrete.rsc, Feb–Jun 2012 [GitHub]

Summary

Syntax

Program ::=
	[prg]::[functions]::{Function "\n"}+
Expr ::=
	[ifThenElse]::("if" [cond]::Expr "then" [thenbranch]::Expr "else" [elsebranch]::Expr)
Expr ::=
	"(" [e]::Expr ")"
Expr ::=
	[literal]::[i]::Int
Expr ::=
	[argument]::[a]::Name
Expr ::=
	[binary]::([lexpr]::Expr [op]::Ops [rexpr]::Expr)
Expr ::=
	[apply]::([f]::Name [vargs]::Expr+)
Ops ::=
	[plus]::"+"
Ops ::=
	[equal]::"=="
Ops ::=
	[minus]::"-"
Function ::=
	[fun]::([f]::Name [args]::Name+ "=" [body]::Expr)

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