Browsable Logo Grammar

CC-BY

Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: logo/klint/extracted
Source used for this grammar: Paul Klint, Logo.sdf, March 2007 [GitHub]

Summary

Syntax

Program ::=
	Commands
Commands ::=
	Command*
Command ::=
	BasicCommand
	FunctionDef
	Call
BasicCommand ::=
	"if" Exp Block
	"ifelse" Exp Block Block
	"repeat" Exp Block
	"forward" Exp
	"back" Exp
	"left" Exp
	"right" Exp
	"setxy" Exp Exp
	"setx" Exp
	"sety" Exp
	"home"
	"showturtle"
	"hideturtle"
	"clean"
	"clearscreen"
	"pendown"
	"penup"
	"pencolor" Color
	"local" QuotedId
	"make" QuotedId Exp
Exp ::=
	Integer
	Formal
	"xcor"
	"ycor"
	"heading"
	"towards" Exp Exp
	"pendown?"
	"sum" Exp Exp
	"difference" Exp Exp
	"product" Exp Exp
	"quotient" Exp Exp
	"remainder" Exp Exp
	"minus" Exp
	"less?" Exp Exp
	"greater?" Exp Exp
	"equal?" Exp Exp
	"notequal?" Exp Exp
Block ::=
	"[" Command* "]"
FunctionDef ::=
	"to" Id Formal* Block
Id ::=
	"xcor"
	"ycor"
	"heading"
	"towards"
	"pendown?"
	"sum"
	"difference"
	"product"
	"quotient"
	"remainder"
	"minus"
	"less?"
	"greater?"
	"equal?"
	"notequal?"
	"to"
	"if"
	"ifelse"
	"repeat"
	"forward"
	"back"
	"left"
	"right"
	"setxy"
	"setx"
	"sety"
	"home"
	"showturtle"
	"hideturtle"
	"clean"
	"clearscreen"
	"pendown"
	"penup"
	"local"
	"make"
Call ::=
	Id Exp*

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