SlideShare a Scribd company logo
Convention-Based Syntactic Descriptions Ray Toal Derek Smith Loyola Marymount University CSIE 2009, Los Angeles 2009-04-02
Outline Introduction
Goals and Objectives
Motivation and Challenges
Approach
Conventions
Summary
Future Work
Objectives Design a improved syntax formalism for programming languages, that can BOTH be used as a concise, formal description, and
be used as input to a parser generator Formalism must also be understandable to users of existing notations so we're basically using EBNF
... with some regex notation and custom extensions
Motivation Few programming language specifications care to even separate microsyntax and macrosyntax ID -> LETTER (LETTER | DIGIT | '_')*
STMT -> 'while' EXP 'do' BLOCK Existing parser generator input languages have too much markup
Idea: Try to adapt convention over configuration to reduce markup requirements!
Challenges Existing formalisms are  necessarily  parser generator independent: e.g., don't want to commit to LL or LR Solution: Allow rich EBNF extensions to make LL a viable option Existing generators allow code to be run during parse Solution: Restrict “generation” to AST nodes only.
Microsyntax Example For a little C-like language: LETTER -> <L> DIGIT -> <Nd> CHAR -> [ˆ<Cc>&quot;\] | '\' [ˆ<Cc>] ID -> LETTER (LETTER | DIGIT | '_')* KEYWORD -> 'var' | 'fun' | 'read' | 'write' | 'while' | 'do' | 'end' NUMLIT -> DIGIT+ ('.' DIGIT+)? ([Ee] [+-]? DIGIT+)? STRLIT -> '&quot;' CHAR* '&quot;' SKIP -> <Zs> | #09 | #0A | #0D | '//' [ˆ#0A#0D]* [#0A#0D]
Microsyntax Rules use ->, and no delimiters needed
Rules must be non-recursive, and RHS can only use symbols from previous rules
Later rules take precedence In our example 'while' is a KEYWORD, not an ID
Means we don't need '-' meta operator SKIP predefined and must be last

More Related Content

PPT
Lecture 13 intermediate code generation 2.pptx
PPTX
Syntax analyzer
PPT
02. chapter 3 lexical analysis
PPT
Chapter Three(1)
PDF
Lexical
PPT
The JavaScript Programming Language
PPT
The Java Script Programming Language
Lecture 13 intermediate code generation 2.pptx
Syntax analyzer
02. chapter 3 lexical analysis
Chapter Three(1)
Lexical
The JavaScript Programming Language
The Java Script Programming Language

What's hot (20)

PPT
Javascript
PDF
Syntax analysis
PDF
Data types in c++
PPT
Glimpses of C++0x
ODP
LVEE 2014: Text parsing with Python and PLY
PPTX
Language for specifying lexical Analyzer
PPTX
Lecture 02 lexical analysis
PDF
Lexicalanalyzer
PDF
Syntactic analysis in NLP
DOCX
Unit 1 question and answer
PDF
Compiler Construction | Lecture 3 | Syntactic Editor Services
PPT
Andy On Closures
PPT
Basics of C programming
PPTX
System Programming Unit IV
PDF
Syntax directed translation
PDF
Lecture 3 RE NFA DFA
PPTX
Syntax-Directed Translation into Three Address Code
PPT
Chapter 6 Intermediate Code Generation
PPTX
Introduction to Python Basics
Javascript
Syntax analysis
Data types in c++
Glimpses of C++0x
LVEE 2014: Text parsing with Python and PLY
Language for specifying lexical Analyzer
Lecture 02 lexical analysis
Lexicalanalyzer
Syntactic analysis in NLP
Unit 1 question and answer
Compiler Construction | Lecture 3 | Syntactic Editor Services
Andy On Closures
Basics of C programming
System Programming Unit IV
Syntax directed translation
Lecture 3 RE NFA DFA
Syntax-Directed Translation into Three Address Code
Chapter 6 Intermediate Code Generation
Introduction to Python Basics
Ad

Similar to Convention-Based Syntactic Descriptions (20)

PPT
Processing XML with Java
PPT
ITU - MDD - Textural Languages and Grammars
PDF
7986-lect 7.pdf
PPT
LEX lexical analyzer for compiler theory.ppt
PPTX
Combinators, DSLs, HTML and F#
PPTX
The Style of C++ 11
PPTX
Web technologies-course 07.pptx
PPT
Python scripting kick off
PPTX
Python Programming Basics for begginners
PPTX
Coding standards for java
PPTX
6 assembly language computer organization
ODP
Aspect-oriented programming in Perl
PDF
DEFUN 2008 - Real World Haskell
PPTX
python and perl
PPTX
outline : basicc elements of assembly language
PPT
Syntax analysis
PPT
Syntax analysis
PPT
An Annotation Framework for Statically-Typed Syntax Trees
PPT
Lec 04 intro assembly
PPT
Introduction to PHP
Processing XML with Java
ITU - MDD - Textural Languages and Grammars
7986-lect 7.pdf
LEX lexical analyzer for compiler theory.ppt
Combinators, DSLs, HTML and F#
The Style of C++ 11
Web technologies-course 07.pptx
Python scripting kick off
Python Programming Basics for begginners
Coding standards for java
6 assembly language computer organization
Aspect-oriented programming in Perl
DEFUN 2008 - Real World Haskell
python and perl
outline : basicc elements of assembly language
Syntax analysis
Syntax analysis
An Annotation Framework for Statically-Typed Syntax Trees
Lec 04 intro assembly
Introduction to PHP
Ad

More from Ray Toal (6)

PPTX
Git workshop
PPTX
Learning and Modern Programming Languages
PPTX
Java best practices
PPTX
unittest in 5 minutes
PPT
Economics of Open Source Software
PPTX
Modeling Patterns for JavaScript Browser-Based Games
Git workshop
Learning and Modern Programming Languages
Java best practices
unittest in 5 minutes
Economics of Open Source Software
Modeling Patterns for JavaScript Browser-Based Games

Recently uploaded (20)

PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
TLE Review Electricity (Electricity).pptx
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Encapsulation theory and applications.pdf
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Mushroom cultivation and it's methods.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPT
Teaching material agriculture food technology
PDF
Empathic Computing: Creating Shared Understanding
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Approach and Philosophy of On baking technology
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Unlocking AI with Model Context Protocol (MCP)
Digital-Transformation-Roadmap-for-Companies.pptx
Group 1 Presentation -Planning and Decision Making .pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
SOPHOS-XG Firewall Administrator PPT.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
TLE Review Electricity (Electricity).pptx
cloud_computing_Infrastucture_as_cloud_p
Encapsulation theory and applications.pdf
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
NewMind AI Weekly Chronicles - August'25-Week II
Advanced methodologies resolving dimensionality complications for autism neur...
Mushroom cultivation and it's methods.pdf
Encapsulation_ Review paper, used for researhc scholars
Teaching material agriculture food technology
Empathic Computing: Creating Shared Understanding
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Approach and Philosophy of On baking technology

Convention-Based Syntactic Descriptions