SlideShare a Scribd company logo
1 of 92
Download to read offline
IN4303 2015/16
Compiler Construction
Language Specification
syntax definition
Guido Wachsmuth, Eduardo de Souza Amorim
Syntax Definition 2
3 * +7 21
3 * +7 21
Exp ExpExp
Exp
Exp
parser
Syntax Definition 3
3 * +7 21
parser
Const
Mul
Const
213 7
Const
Add
Syntax Definition 4
3 * +7 21
parser
Add(
Mul(
Const(3)
, Const(7)
)
, Const(21)
)
Syntax Definition
Stratego
NaBL
TS
SDF3
ESV
editor
SPT
tests
5
syntax definition
concrete syntax
abstract syntax
static semantics
name binding
type system
dynamic semantics
translation
interpretation
Syntax Definition 6
syntax definition
regular expressions
Backus-Naur Form
Extended BNF
SDF3
lexical syntax
context-free syntax
abstract syntax
disambiguation
Spoofax
architecture
testing
editors
syntax processing
pretty-printing
discovery
more editor services
Syntax Definition 7
syntax definition
Syntax Definition 8
software languages
Syntax Definition 9
finite models
Syntax Definition 10
Philosophy
Linguistics
lexicology
grammar
morphology
syntax
phonology
semantics
Interdisciplinary
Computer Science
syntax
semantics
Syntax Definition 11
lexical syntax
words made from letters
irrelevant structure
literals 42 "foo" true
identifiers x foo
keywords if while
operators + *
whitespace // FIXME
regular expressions

context-free syntax
sentences made from words
relevant structure
context-free grammars
Backus-Naur Form
Extended Backus-Naur Form
computer science
syntax
Syntax Definition 12
syntax definition
regular expressions
Syntax Definition 13
basics
strings "nil"
character classes [a-zA-Z]
combinators
concatenation E1 E2
option E?
repetition (zero or more) E*
repetition (one or more) E+
alternative E1 | E2
regular expressions
Syntax Definition 14
/* factorial function */
let
var x := 0
function fact(n : int) : int =
if n < 1 then 1 else (n * fact(n - 1))
in
for i := 1 to 3 do (
x := x + fact(i);
printint(x);
print(" ")
)
end
Tiger
the lecture language
Syntax Definition 15
An identifier is a sequence of letters,
digits, and under-scores, starting with a
letter. Uppercase letters are distinguished
from lowercase.
Tiger
lexical syntax
Syntax Definition 15
An identifier is a sequence of letters,
digits, and under-scores, starting with a
letter. Uppercase letters are distinguished
from lowercase.
[a-zA-Z][a-zA-Z0-9_]*
Tiger
lexical syntax
Syntax Definition 15
An identifier is a sequence of letters,
digits, and under-scores, starting with a
letter. Uppercase letters are distinguished
from lowercase.
[a-zA-Z][a-zA-Z0-9_]*
A comment may appear between any two
tokens. Comments start with /* and end
with */ and may be nested.
Tiger
lexical syntax
Syntax Definition 15
An identifier is a sequence of letters,
digits, and under-scores, starting with a
letter. Uppercase letters are distinguished
from lowercase.
[a-zA-Z][a-zA-Z0-9_]*
A comment may appear between any two
tokens. Comments start with /* and end
with */ and may be nested.
Tiger
lexical syntax
Pumping Lemma
Syntax Definition 16
syntax definition
Backus-Naur Form
Syntax Definition 17
basics
strings nil
symbols <s>
combinators
concatenation E1 E2
production <s> ::= E1 | … | En
Backus-Naur Form
Syntax Definition 18
<exp> ::= <num>
| <exp> + <exp>
| <exp> - <exp>
| <exp> * <exp>
| <exp> / <exp>
| ( <exp> )
Tiger
context-free syntax
Syntax Definition 19
syntax definition
Extended Backus-Naur Form
Syntax Definition 20
basics
strings "nil"
symbols s
combinators
concatenation E1,E2
option [E]
repetition (zero or more) {E}
alternative E1 | E2
production s = E1 | … | En ;
Extended Backus-Naur Form
Syntax Definition 21
exp = num
| exp , "+" , exp
| exp , "-" , exp
| exp , "*" , exp
| exp , "/" , exp
| "(" , exp , ")" ;
Tiger
context-free syntax
Syntax Definition 22
SDF3
lexical syntax
Syntax Definition 23
basics
strings "nil"
character classes [a-zA-Z]
complements ~[a-zA-Z]
sorts S
combinators
concatenation E1 E2
option E?
repetition (zero or more) E*
with separator {E s}*
repetition (one or more) E+
with separator {E s}+
alternative E1 | E2
production S = E
SDF3
lexical syntax
Syntax Definition 24
module Literals
lexical syntax
ID = [a-zA-Z] [a-zA-Z0-9_]*
INT = "-"? [0-9]+
STRING = """ StringChar* """
StringChar = ~["n]
StringChar = """
StringChar = ""
Tiger
lexical syntax
Syntax Definition 25
module Whitespace
lexical syntax
LAYOUT = [ tnr]
LAYOUT = "//" ~[nr]* NewLineEOF
NewLineEOF = [nr] | EOF
EOF =
LAYOUT = "/*" CommentPart* "*/"
CommentPart = ~[*]
CommentPart = [*]
Tiger
lexical syntax
Syntax Definition 26
SDF3
context-free syntax
Syntax Definition 27
basics
strings "nil"
sorts S
combinators
concatenation E1 E2
option E?
repetition (zero or more) E*
with separator {E s}*
repetition (one or more) E+
with separator {E s}+
production S = E
SDF3
context-free syntax
Syntax Definition 28
module Expressions
context-free syntax
Exp = LValue
LValue = ID
LValue = LValue "." ID
LValue = LValue "[" Exp "]"
Exp = "nil"
Exp = INT
Exp = STRING
Exp = ID "(" {Exp ","}* ")"
Exp = TypeId "{" {InitField ","}* "}"
Exp = TypeId "[" Exp "]" "of" Exp
InitField = ID "=" Exp
Tiger
context-free syntax
x
x.f1
x[i]
nil
42
"foo"
sqr(x)
aty [x] of 42
rty {f1 = "foo", f2 = 42}
Syntax Definition 29
context-free syntax
Exp = Exp "+" Exp
Exp = Exp "-" Exp
Exp = Exp "*" Exp
Exp = Exp "/" Exp
Exp = Exp "=" Exp
Exp = Exp "<>" Exp
Exp = Exp ">" Exp
Exp = Exp "<" Exp
Exp = Exp ">=" Exp
Exp = Exp "<=" Exp
Exp = Exp "&" Exp
Exp = Exp "|" Exp
Tiger
context-free syntax
Syntax Definition 30
SDF3
abstract syntax
Syntax Definition 31
tree
leaf
parent node
children are trees
term
constant
constructor
arguments are terms
ATerms
trees - terms
Const
Mul
Const
213 7
Const
Add
Add(
Mul(
Const(3)
, Const(7)
)
, Const(21)
)
Syntax Definition 32
context-free syntax
Exp.Add = Exp "+" Exp
Exp.Sub = Exp "-" Exp
Exp.Mul = Exp "*" Exp
Exp.Div = Exp "/" Exp
Exp.Eq = Exp "=" Exp
Exp.Neq = Exp "<>" Exp
Exp.Gt = Exp ">" Exp
Exp.Lt = Exp "<" Exp
Exp.Gte = Exp ">=" Exp
Exp.Lte = Exp "<=" Exp
Exp.And = Exp "&" Exp
Exp.Or = Exp "|" Exp
Tiger
context-free syntax
Const
Mul
Const
213 7
Const
Add
Add(
Mul(
Const(3)
, Const(7)
)
, Const(21)
)
Syntax Definition 33
SDF3
disambiguation
Syntax Definition 34
lexical syntax
ID = [a-zA-Z] [a-zA-Z0-9_]*
ID = "nil" {reject}
INT = "-"? [0-9]+
lexical restrictions
ID -/- [a-zA-Z0-9_]
INT -/- [0-9]
Tiger
lexical disambiguation
Syntax Definition 35
lexical syntax
LAYOUT = "//" ~[nr]* NewLineEOF
NewLineEOF = [nr] | EOF
EOF =
LAYOUT = "/*" CommentPart* "*/"
CommentPart = ~[*]
CommentPart = "*"
lexical restrictions
EOF -/- ~[] "*" -/- ~[/]
Tiger
lexical disambiguation
Syntax Definition 36
lexical syntax
LAYOUT = "//" ~[nr]* NewLineEOF
NewLineEOF = [nr] | EOF
EOF =
LAYOUT = "/*" CommentPart* "*/"
CommentPart = ~[*]
CommentPart = CommentEndChar
CommentEndChar = "*"
lexical restrictions
EOF -/- ~[] CommentEndChar -/- ~[/]
Tiger
lexical disambiguation
Syntax Definition 37
lexical syntax
LAYOUT = [ tnr]
LAYOUT = "//" ~[nr]* NewLineEOF
LAYOUT = "/*" CommentPart* "*/"
context-free restrictions
LAYOUT? -/- [ tnr]
LAYOUT? -/- [/].[/]
LAYOUT? -/- [/].[*]
Tiger
context-free disambiguation
Syntax Definition 38
context-free syntax
Exp.Add = Exp "+" Exp
Exp.Sub = Exp "-" Exp
Exp.Mul = Exp "*" Exp
Exp.Div = Exp "/" Exp
Exp.Eq = Exp "=" Exp
Exp.Neq = Exp "<>" Exp
Exp.Gt = Exp ">" Exp
Exp.Lt = Exp "<" Exp
Exp.Gte = Exp ">=" Exp
Exp.Lte = Exp "<=" Exp
Exp.And = Exp "&" Exp
Exp.Or = Exp "|" Exp
Tiger
context-free syntax
Syntax Definition 39
context-free syntax
Exp.Add = Exp "+" Exp {left}
Exp.Sub = Exp "-" Exp {left}
Exp.Mul = Exp "*" Exp {left}
Exp.Div = Exp "/" Exp {left}
Exp.Eq = Exp "=" Exp {non-assoc}
Exp.Neq = Exp "<>" Exp {non-assoc}
Exp.Gt = Exp ">" Exp {non-assoc}
Exp.Lt = Exp "<" Exp {non-assoc}
Exp.Gte = Exp ">=" Exp {non-assoc}
Exp.Lte = Exp "<=" Exp {non-assoc}
Exp.And = Exp "&" Exp {left}
Exp.Or = Exp "|" Exp {left}
context-free priorities
{ left:
Exp.Mul
Exp.Div
} > { left:
Exp.Add
Exp.Sub
} > { non-assoc:
Exp.Eq
Exp.Neq
Exp.Gt
Exp.Lt
Exp.Gte
Exp.Lte
} > Exp.And
> Exp.Or
Tiger
context-free disambiguation
Syntax Definition 40
Spoofax
architecture
Syntax Definition 41
source
code
Syntax Definition 41
source
code
parse
Syntax Definition 41
source
code
parse
check
Syntax Definition 41
source
code
parse
check
Syntax Definition 41
source
code
parse generate
machine
code
check
Syntax Definition
Data
Programs
Language Processors
42
Eclipse JDT
Fact.java
42
Java
Java
int
Syntax Definition 43
language
definition
parse generate
language
implementation
check
Syntax Definition
syntax
definition
44
parse generate
parse
table
check
generic
parser
Syntax Definition
Data
Programs
Language Processors
45
Java parser
Fact.java
42
Language Workbench Spoofax
SDF3
Java
int
SDF3
Syntax Definition 46
context-free syntax
Grammar.Lexical = <
lexical syntax
<Production*>
>
Grammar.Contextfree = <
context-free syntax
<Production*>
>
Production.SdfProduction = <<Symbol> = <Symbol*> <Attributes>>
Production.SdfProductionWithCons = <<SortCons> = <Symbol*> <Attributes>>
SortCons.SortCons = <<Symbol>.<Constructor>>
context-free syntax
SDF3 in SDF3
Syntax Definition
Stratego
NaBL
TS
SDF3
ESV
editor
SPT
tests
47
syntax definition
concrete syntax
abstract syntax
static semantics
name binding
type system
dynamic semantics
translation
interpretation
Syntax Definition
Stratego
NaBL
TS
SDF3
ESV
editor
SPT
tests
48
syntax definition
concrete syntax
abstract syntax
static semantics
name binding
type system
dynamic semantics
translation
interpretation
Syntax Definition 49
Spoofax
testing
Syntax Definition 50
module example-suite
language Tiger
start symbol Start
test name
[[...]]
parse succeeds
test another name
[[...]]
parse fails
test suites
Syntax Definition 51
test cases
syntax
Language
valid program
test valid program
[[...]]
parse succeeds
Syntax Definition 52
test cases
syntax
Language
test invalid program
[[...]]
parse fails
invalid program
Syntax Definition 53
module syntax/identifiers
language Tiger start symbol Id
test single lower case [[x]] parse succeeds
test single upper case [[X]] parse succeeds
test single digit [[1]] parse fails
test single lc digit [[x1]] parse succeeds
test single digit lc [[1x]] parse fails
test single uc digit [[X1]] parse succeeds
test single digit uc [[1X]] parse fails
test double digit [[11]] parse fails
test cases
syntax
Syntax Definition
Language
54
test cases
syntax
Syntax Definition 55
module syntax/expressions/precedence
language Tiger start symbol Exp
test parentheses
[[(42)]] parse to [[42]]
test left-associative addition
[[21 + 14 + 7]] parse to [[(21 + 14) + 7]]
test precedence multiplication
[[3 * 7 + 21]] parse to [[(3 * 7) + 21]]
test cases
ambiguities
Syntax Definition 56
Spoofax
editors
Syntax Definition
syntax
definition
57
parse generate
parse
table
check
generic
parser
Syntax Definition 58
source
code
parse generate
machine
code
check
Syntax Definition 59
module Tiger.main imports ...
language General properties
name: Tiger
id: org.metaborg.cube.tiger
extends: Root
description: "Spoofax-generated editor for the Tiger language"
url: http://metaborg.org
extensions: tig
table: include/Tiger.tbl
start symbols: Start
provider: include/Tiger.ctree
observer: editor-analyze (multifile)
on save: editor-save
editor specification
Syntax Definition 60
syntax processing
Syntax Definition 61
3 * +7 213 * +7 21
3 * +7 21
Exp ExpExp
Exp
Exp
scanner parser
language processors
scanners & parsers
Syntax Definition 62
language processors
scannerless parsers
3 * +7 21
3 * +7 21
Exp ExpExp
Exp
Exp
parser
Syntax Definition 63
syntax processing
pretty-printing
Syntax Definition 64
language processors
compilation by transformation
backend
frontend
parse desugar analyse normalise
generate optimise format
Syntax Definition 65
language processors
pretty-printers
3 * +7 21
3 * +7 21
Exp ExpExp
Exp
Exp
pretty-
printer
Syntax Definition 66
from ASTs to text
keywords
layout: spaces, line breaks,
indentation
specification
partially defined in grammar
missing layout
language processors
pretty-printing
Syntax Definition 67
SDF3
production rules
context-free syntax
Exp.Nil = "nil"
Exp.IntC = INT
Exp.StringC = STRING
Exp.Call = ID "(" {Exp ","}* ")"
Exp.ArrayI = TypeId "[" Exp "]" "of" Exp
Exp.RecordI = TypeId "{" {InitField ","}* "}"
InitField.FieldI = ID "=" Exp
Syntax Definition 68
SDF3
templates
context-free syntax
Exp.Nil = <nil>
Exp.IntC = INT
Exp.StringC = STRING
Exp.Call = <<ID> ( <{Exp ","}*> )>
Exp.ArrayI = <<TypeId> [ <Exp> ] of <Exp>>
Exp.RecordI = <<TypeId> { <{InitField ","}*> }>
InitField.FieldI = <<ID> = <Exp>>
Syntax Definition 69
SDF3
formatted templates
context-free syntax
Exp.Nil = <nil>
Exp.IntC = INT
Exp.StringC = STRING
Exp.Call = <<ID>(<{Exp ", "}*>)>
Exp.ArrayI = <<TypeId>[<Exp>] of <Exp>>
Exp.RecordI = <
<TypeId> {
<{InitField ",n"}*>
}>
InitField.FieldI = <<ID> = <Exp>>
Syntax Definition 70
box layout
basic boxes
_1
“foo”
KW [ “foo” ]
Syntax Definition 71
box layout
horizontal boxes
B B B
H hs=x [ ]B B Bhs=x
Syntax Definition 72
box layout
vertical boxes
V hs=x is=i [ ]B B Bvs=y is=i
B
B
B
Syntax Definition 73
syntax processing
discovery
Syntax Definition 74
discovery
syntactic code completion
Syntax Definition 75
SDF3
formatted templates
context-free syntax
Exp.Nil = <nil>
Exp.IntC = INT
Exp.StringC = STRING
Exp.Call = <<ID>(<{Exp ", "}*>)>
Exp.ArrayI = <<TypeId>[<Exp>] of <Exp>>
Exp.RecordI = <
<TypeId> {
<{InitField ",n"}*>
}>
InitField.FieldI = <<ID> = <Exp>>
Syntax Definition 76
SDF3
generated completion templates
module src-gen/completions/Expressions-esv
completions
completion template Exp : "nil" =
"nil"
completion template Exp : "ID()" =
<ID:ID> "(" <:Exp> ")"
completion template Exp : "TypeId[Exp] of Exp" =
<TypeId:TypeId> "[" <Exp:Exp> "] of " <Exp:Exp>
completion template Exp : "TypeId { }" =
<TypeId:TypeId> " {nt" (cursor) "n}" (blank)
completion template InitField : "ID = Exp" =
<ID:ID> " = " <Exp:Exp>
Syntax Definition 77
SDF3
improved templates
context-free syntax
Exp.Nil = <nil>
Exp.IntC = INT
Exp.StringC = STRING
Exp.Call = <<ID; text="m">(<{Exp ", "}*>)>
Exp.ArrayI = <<TypeId; text="type">[<Exp; text="size">] of <Exp; text="value">>
Exp.RecordI = <
<TypeId; text="type"> {
<{InitField ",n"}*>
}>
InitField.FieldI = <<ID; text="var"> = <Exp; text="value">>
Syntax Definition 78
syntax processing
more editor services
Syntax Definition 79
editor servicesThe Spoofax Language Workbench
Syntax Definition 80
Spoofax
generated highlighting rules
module Tiger-Colorer.generated
colorer Default, token-based highlighting
keyword : 127 0 85 bold
identifier : default
string : blue
number : darkgreen
var : 255 0 100 italic
operator : 0 0 128
layout : 100 100 0 italic
colorer System colors
darkred = 128 0 0
red = 255 0 0
darkgreen = 0 128 0
green = 0 255 0
darkblue = 0 0 128
…
Syntax Definition 81
Spoofax
customised highlighting rules
module Tiger-Colorer
imports Tiger-Colorer.generated
colorer TU Delft colours
TUDlavender = 123 160 201
colorer token-based highlighting
layout : TUDlavender
StrConst : darkgreen
TypeId : blue
Syntax Definition 82
SDF3
generated folding rules
module Tiger-Folding.generated
folding Default folding definitions
Exp
Dec.TypeDec
Type.RecordTy
Syntax Definition 83
Spoofax
customised folding rules
module Tiger-Folding
imports Tiger-Folding.generated
folding
Dec*
Dec.FunDec
Syntax Definition 84
Except where otherwise noted, this work is licensed under
Syntax Definition 85
attribution
slide title author license
1 The Pine, Saint Tropez Paul Signac public domain
2-4, 43, 45, 46, 59, 60, 63,
64, 66, 67
PICOL icons Melih Bilgil CC BY 3.0
8 Programming language textbooks K.lee public domain
9 Latin Grammar Anthony Nelzin
14, 15, 18, 21 Tiger Bernard Landgraf CC BY-SA 3.0

More Related Content

What's hot

Regex Presentation
Regex PresentationRegex Presentation
Regex Presentation
arnolambert
 

What's hot (20)

Static Analysis
Static AnalysisStatic Analysis
Static Analysis
 
Term Rewriting
Term RewritingTerm Rewriting
Term Rewriting
 
Declare Your Language: Syntactic (Editor) Services
Declare Your Language: Syntactic (Editor) ServicesDeclare Your Language: Syntactic (Editor) Services
Declare Your Language: Syntactic (Editor) Services
 
Compiler Components and their Generators - Lexical Analysis
Compiler Components and their Generators - Lexical AnalysisCompiler Components and their Generators - Lexical Analysis
Compiler Components and their Generators - Lexical Analysis
 
Compiler Components and their Generators - Traditional Parsing Algorithms
Compiler Components and their Generators - Traditional Parsing AlgorithmsCompiler Components and their Generators - Traditional Parsing Algorithms
Compiler Components and their Generators - Traditional Parsing Algorithms
 
Dynamic Semantics
Dynamic SemanticsDynamic Semantics
Dynamic Semantics
 
Static name resolution
Static name resolutionStatic name resolution
Static name resolution
 
Introduction - Imperative and Object-Oriented Languages
Introduction - Imperative and Object-Oriented LanguagesIntroduction - Imperative and Object-Oriented Languages
Introduction - Imperative and Object-Oriented Languages
 
Declare Your Language: Type Checking
Declare Your Language: Type CheckingDeclare Your Language: Type Checking
Declare Your Language: Type Checking
 
Declare Your Language: Transformation by Strategic Term Rewriting
Declare Your Language: Transformation by Strategic Term RewritingDeclare Your Language: Transformation by Strategic Term Rewriting
Declare Your Language: Transformation by Strategic Term Rewriting
 
Regular expression examples
Regular expression examplesRegular expression examples
Regular expression examples
 
Declare Your Language: Name Resolution
Declare Your Language: Name ResolutionDeclare Your Language: Name Resolution
Declare Your Language: Name Resolution
 
Compiler Construction | Lecture 5 | Transformation by Term Rewriting
Compiler Construction | Lecture 5 | Transformation by Term RewritingCompiler Construction | Lecture 5 | Transformation by Term Rewriting
Compiler Construction | Lecture 5 | Transformation by Term Rewriting
 
Ch04
Ch04Ch04
Ch04
 
CS4200 2019 | Lecture 5 | Transformation by Term Rewriting
CS4200 2019 | Lecture 5 | Transformation by Term RewritingCS4200 2019 | Lecture 5 | Transformation by Term Rewriting
CS4200 2019 | Lecture 5 | Transformation by Term Rewriting
 
Compiler Construction | Lecture 8 | Type Constraints
Compiler Construction | Lecture 8 | Type ConstraintsCompiler Construction | Lecture 8 | Type Constraints
Compiler Construction | Lecture 8 | Type Constraints
 
Dynamic Semantics Specification and Interpreter Generation
Dynamic Semantics Specification and Interpreter GenerationDynamic Semantics Specification and Interpreter Generation
Dynamic Semantics Specification and Interpreter Generation
 
Ch03
Ch03Ch03
Ch03
 
Regex Presentation
Regex PresentationRegex Presentation
Regex Presentation
 
Perl6 signatures
Perl6 signaturesPerl6 signatures
Perl6 signatures
 

Viewers also liked (11)

The Universe: A Module in Science and Technology for Grade 5 Pupils
The Universe: A Module in Science and Technology for Grade 5 PupilsThe Universe: A Module in Science and Technology for Grade 5 Pupils
The Universe: A Module in Science and Technology for Grade 5 Pupils
 
Syntactic change through translation: A corpus-based approach to language change
Syntactic change through translation: A corpus-based approach to language changeSyntactic change through translation: A corpus-based approach to language change
Syntactic change through translation: A corpus-based approach to language change
 
Syntax analysis
Syntax analysisSyntax analysis
Syntax analysis
 
Syntax
SyntaxSyntax
Syntax
 
Model of Teaching
Model of TeachingModel of Teaching
Model of Teaching
 
Teaching models
Teaching modelsTeaching models
Teaching models
 
Syntactic space syntax4generativedesign
Syntactic space syntax4generativedesignSyntactic space syntax4generativedesign
Syntactic space syntax4generativedesign
 
Syntax
SyntaxSyntax
Syntax
 
ENGLISH SYNTAX
ENGLISH SYNTAXENGLISH SYNTAX
ENGLISH SYNTAX
 
Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming language
 
Models of teaching
Models of teachingModels of teaching
Models of teaching
 

Similar to Syntax Definition

TI1220 Lecture 9: Parsing & interpretation
TI1220 Lecture 9: Parsing & interpretationTI1220 Lecture 9: Parsing & interpretation
TI1220 Lecture 9: Parsing & interpretation
Eelco Visser
 
仕事で使うF#
仕事で使うF#仕事で使うF#
仕事で使うF#
bleis tift
 
An Annotation Framework for Statically-Typed Syntax Trees
An Annotation Framework for Statically-Typed Syntax TreesAn Annotation Framework for Statically-Typed Syntax Trees
An Annotation Framework for Statically-Typed Syntax Trees
Ray Toal
 
Chapter Three(1)
Chapter Three(1)Chapter Three(1)
Chapter Three(1)
bolovv
 

Similar to Syntax Definition (20)

CS4200 2019 | Lecture 4 | Syntactic Services
CS4200 2019 | Lecture 4 | Syntactic ServicesCS4200 2019 | Lecture 4 | Syntactic Services
CS4200 2019 | Lecture 4 | Syntactic Services
 
CS4200 2019 | Lecture 3 | Parsing
CS4200 2019 | Lecture 3 | ParsingCS4200 2019 | Lecture 3 | Parsing
CS4200 2019 | Lecture 3 | Parsing
 
Regexp
RegexpRegexp
Regexp
 
Ch2 (1).ppt
Ch2 (1).pptCh2 (1).ppt
Ch2 (1).ppt
 
Ch2
Ch2Ch2
Ch2
 
Open course(programming languages) 20150225
Open course(programming languages) 20150225Open course(programming languages) 20150225
Open course(programming languages) 20150225
 
codin9cafe[2015.02.25]Open course(programming languages) - 장철호(Ch Jang)
codin9cafe[2015.02.25]Open course(programming languages) - 장철호(Ch Jang)codin9cafe[2015.02.25]Open course(programming languages) - 장철호(Ch Jang)
codin9cafe[2015.02.25]Open course(programming languages) - 장철호(Ch Jang)
 
TI1220 Lecture 9: Parsing & interpretation
TI1220 Lecture 9: Parsing & interpretationTI1220 Lecture 9: Parsing & interpretation
TI1220 Lecture 9: Parsing & interpretation
 
Compiler Construction | Lecture 4 | Parsing
Compiler Construction | Lecture 4 | Parsing Compiler Construction | Lecture 4 | Parsing
Compiler Construction | Lecture 4 | Parsing
 
FYP Final Presentation
FYP Final PresentationFYP Final Presentation
FYP Final Presentation
 
Awk essentials
Awk essentialsAwk essentials
Awk essentials
 
仕事で使うF#
仕事で使うF#仕事で使うF#
仕事で使うF#
 
Compiler Construction | Lecture 3 | Syntactic Editor Services
Compiler Construction | Lecture 3 | Syntactic Editor ServicesCompiler Construction | Lecture 3 | Syntactic Editor Services
Compiler Construction | Lecture 3 | Syntactic Editor Services
 
Build a compiler in 2hrs - NCrafts Paris 2015
Build a compiler in 2hrs -  NCrafts Paris 2015Build a compiler in 2hrs -  NCrafts Paris 2015
Build a compiler in 2hrs - NCrafts Paris 2015
 
Bioinformatica 06-10-2011-p2 introduction
Bioinformatica 06-10-2011-p2 introductionBioinformatica 06-10-2011-p2 introduction
Bioinformatica 06-10-2011-p2 introduction
 
An Annotation Framework for Statically-Typed Syntax Trees
An Annotation Framework for Statically-Typed Syntax TreesAn Annotation Framework for Statically-Typed Syntax Trees
An Annotation Framework for Statically-Typed Syntax Trees
 
Lexical
LexicalLexical
Lexical
 
Perl6 Regexen: Reduce the line noise in your code.
Perl6 Regexen: Reduce the line noise in your code.Perl6 Regexen: Reduce the line noise in your code.
Perl6 Regexen: Reduce the line noise in your code.
 
Chapter Three(1)
Chapter Three(1)Chapter Three(1)
Chapter Three(1)
 
Use PEG to Write a Programming Language Parser
Use PEG to Write a Programming Language ParserUse PEG to Write a Programming Language Parser
Use PEG to Write a Programming Language Parser
 

More from Guido Wachsmuth

Domain-Specific Type Systems
Domain-Specific Type SystemsDomain-Specific Type Systems
Domain-Specific Type Systems
Guido Wachsmuth
 

More from Guido Wachsmuth (10)

Language
LanguageLanguage
Language
 
Domain-Specific Type Systems
Domain-Specific Type SystemsDomain-Specific Type Systems
Domain-Specific Type Systems
 
Declarative Syntax Definition - Pretty Printing
Declarative Syntax Definition - Pretty PrintingDeclarative Syntax Definition - Pretty Printing
Declarative Syntax Definition - Pretty Printing
 
Compiler Components and their Generators - LR Parsing
Compiler Components and their Generators - LR ParsingCompiler Components and their Generators - LR Parsing
Compiler Components and their Generators - LR Parsing
 
Compiling Imperative and Object-Oriented Languages - Garbage Collection
Compiling Imperative and Object-Oriented Languages - Garbage CollectionCompiling Imperative and Object-Oriented Languages - Garbage Collection
Compiling Imperative and Object-Oriented Languages - Garbage Collection
 
Compiling Imperative and Object-Oriented Languages - Register Allocation
Compiling Imperative and Object-Oriented Languages - Register AllocationCompiling Imperative and Object-Oriented Languages - Register Allocation
Compiling Imperative and Object-Oriented Languages - Register Allocation
 
Compiling Imperative and Object-Oriented Languages - Dataflow Analysis
Compiling Imperative and Object-Oriented Languages - Dataflow AnalysisCompiling Imperative and Object-Oriented Languages - Dataflow Analysis
Compiling Imperative and Object-Oriented Languages - Dataflow Analysis
 
Compiling Imperative and Object-Oriented Languages - Activation Records
Compiling Imperative and Object-Oriented Languages - Activation RecordsCompiling Imperative and Object-Oriented Languages - Activation Records
Compiling Imperative and Object-Oriented Languages - Activation Records
 
Declarative Semantics Definition - Code Generation
Declarative Semantics Definition - Code Generation Declarative Semantics Definition - Code Generation
Declarative Semantics Definition - Code Generation
 
Software Languages
Software LanguagesSoftware Languages
Software Languages
 

Recently uploaded

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Recently uploaded (20)

Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 

Syntax Definition

Editor's Notes

  1. demo Tiger compiler
  2. feedback loop
  3. feedback loop
  4. feedback loop
  5. feedback loop
  6. feedback loop
  7. talk about languagetalk about a language by using a language
  8. talk about languagetalk about a language by using a language
  9. demo Tiger compiler