DEVIL Device configuration language By Boklyn Wong Pranay Tigga Vishal Kumar Singh.

Slides:



Advertisements
Similar presentations
Optional Static Typing Guido van Rossum (with Paul Prescod, Greg Stein, and the types-SIG)
Advertisements

Question Bank. Explain the syntax of if else statement? Define Union Define global and local variables with example Concept of recursion with example.
CardGhost ——Language design for card game Team member: Yang Jian, yj2220 Xiaoming Guo, gx2158 Yu An, ya2249 Dingding Xi, dx2131 Feng Zhou, fz2168.
Programming Languages and Paradigms The C Programming Language.
1 Languages and Compilers (SProg og Oversættere) Code Generation.
Control Flow Analysis (Chapter 7) Mooly Sagiv (with Contributions by Hanne Riis Nielson)
1 Compiler Construction Intermediate Code Generation.
Introduction to Unix – CS 21 Lecture 11. Lecture Overview Shell Programming Variable Discussion Command line parameters Arithmetic Discussion Control.
Elaboration or: Semantic Analysis Compiler Baojian Hua
BROOM: A Matrix Language Chris Tobin Michael Weiss Gabe Glaser Brian Pellegrini.
WPSM Programming Language A simple language that transform simple data structure into complex xML format Wai Y. Wong Peter Chen Seema Gupta Miqdad Mohammed.
Honors Compilers Semantic Analysis and Attribute Grammars Mar 5th 2002.
Sudoku Game Design Language (SGDL) Sijue Tan Rongzheng Yan Yu Shao Yigang Zhang William Chan.
Environments and Evaluation
Semantic analysis Enforce context-dependent language rules that are not reflected in the BNF, e.g.a function must have a return statement. Decorate AST.
CS252 Lab 2 Prepared by El Kindi Rezig. Notes Check out new version of the “official” fiz interpreter at
HP48 Simulator for Windows CE Roman Barsky Alon Nozic Supervisor: Alexander Arlievsky.
Programming Languages 2nd edition Tucker and Noonan Chapter 6 Types I was eventually persuaded of the need to design programming notations so as to maximize.
Interfaces besides classes, Java recognizes another type, an interface interface is used to completely shield off all implementation from the programmer.
The Interpreter Pattern. Defining the Interpreter Intent Given a language, define a representation for its grammar along with an interpreter that uses.
Symbol Table (  ) Contents Map identifiers to the symbol with relevant information about the identifier All information is derived from syntax tree -
Imperative Programming
CSc 453 Semantic Analysis Saumya Debray The University of Arizona Tucson.
COP4020 Programming Languages
CSC 338: Compiler design and implementation
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 12: Pointers continued, C strings.
Lesson 3 CDT301 – Compiler Theory, Spring 2011 Teacher: Linus Källberg.
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
CS412/413 Introduction to Compilers and Translators Spring ’99 Lecture 8: Semantic Analysis and Symbol Tables.
Interpretation Environments and Evaluation. CS 354 Spring Translation Stages Lexical analysis (scanning) Parsing –Recognizing –Building parse tree.
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
Programming with Visual C++: Concepts and Projects Chapter 2B: Reading, Processing and Displaying Data (Tutorial)
Group 4 Java Compiler Group Members: Atul Singh(Y6127) Manish Agrawal(Y6241) Mayank Sachan(Y6253) Sudeept Sinha(Y6483)
C463 / B551 Artificial Intelligence Dana Vrajitoru Python.
PLT Final Project---COLOGO Lixing Dong, Zhou Ma, Chao Song, Siyuan Lu, Dongyang Jiang.
Programming Languages 2nd edition Tucker and Noonan Chapter 6 Type Systems I was eventually persuaded of the need to design programming notations so as.
Runtime Organization (Chapter 6) 1 Course Overview PART I: overview material 1Introduction 2Language processors (tombstone diagrams, bootstrapping) 3Architecture.
CS536 Semantic Analysis Introduction with Emphasis on Name Analysis 1.
The Functions and Purposes of Translators Syntax (& Semantic) Analysis.
LANCOM LAnguage for Network COnfiguration and Management Chitra S Agastya Nipun Arora Sambuddho Chakravarty.
Perl Tutorial. Why PERL ??? Practical extraction and report language Similar to shell script but lot easier and more powerful Easy availablity All details.
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
JavaScript Assignment Statements Expressions Global Functions CST 200 JavaScript.
CS 153: Concepts of Compiler Design September 30 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
What am I? while b != 0 if a > b a := a − b else b := b − a return a AST == Abstract Syntax Tree.
1 A Simple Syntax-Directed Translator CS308 Compiler Theory.
Agenda Comments Identifiers Keywords Syntax and Symentics Indentation Variables Datatype Operator.
CS412/413 Introduction to Compilers Radu Rugina Lecture 11: Symbol Tables 13 Feb 02.
CS 152: Programming Language Paradigms April 7 Class Meeting Department of Computer Science San Jose State University Spring 2014 Instructor: Ron Mak
1 Semantic Analysis  Semantic analysis includes  Dynamic Checking (Those checks for which to perform, compiler doesn’t have sufficient information) 
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Lucas Bang Lecture 11: Pointers.
Array and Pointers An Introduction Unit Unit Introduction This unit covers the usage of pointers and arrays in C++
Ada, Scheme, R Emory Wingard. Ada History Department of Defense in search of high level language around Requirements drafted for the language.
APS105 Functions (and Pointers) 1. Modularity –Break a program into manageable parts (modules) –Modules interoperate with each other Benefits of modularity:
Presentation By :- Nikhil R. Anande ( ) Electronic & Communication Engineering. 3 nd Year / 5 th Semester FACULTY GUIDE : RAHIUL PATEL SIR MICROCONTROLLER.
Lecture 4: Metacircles Eval Apply David Evans
Zuse’s Plankalkül – 1945 Never implemented Problems Zuse Solved
Semantic Analysis with Emphasis on Name Analysis
Student Book An Introduction
Basic Program Analysis: AST
CSE 3302 Programming Languages
Conditional Statements
Lecture 15 (Notes by P. N. Hilfinger and R. Bodik)
CSE401 Introduction to Compiler Construction
Designing a Predictive Parser
PZ09A - Activation records
Semantic Analysis Semantic analysis includes
Activation records Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Activation records Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
AX 2012 Development Training
Presentation transcript:

DEVIL Device configuration language By Boklyn Wong Pranay Tigga Vishal Kumar Singh

Agenda Motivation. Language overview Examples Compiler Design and Implementation Front End Back End Conclusion and Lessons Learnt.

Why DEVIL? Ease of Device Configuration. Too many UI’s and command line interfaces for various devices. Compiler handles complexity and abstracts device idiosyncrasies. Architecture independence.

Language Overview Data Types No data types – decides based on value and usage, can be directly assigned. No declarations, Only Assignment. Internally – Integer, Double and String. E.g. a=10; or a=“abc” ; Internally makes a variable of type String or Integer. Tuples ( kind of Arrays) allow for various kinds of data types, can be restricted).e.g. a[1]=10;a[2]=“Linux”; // is allowed.

Language Overview Expressions similar to C Arithmetic {“+”,”-”,”*”,”/”,”++”,”--”} and Relational {“ ”,” =”} operators If then else For loop While loop Functions Inbuilt functions Scoping : Local and Global Scope.

Language Overview Example 1 Simple.devil i = 10; func add(i,j) { i= i + j; } func main(i) { x =1; x = * 4; y = x +1; add (x, y); } main(i); print x; Example 2 generate.devil ip1 = “ ”; port = 80; block ip; if(port==80) { unblock port; } else { block port; } for (i=0;i<10;i++){ a[i] =I; print a[i]; }

Compiler design Lexer Parser WalkerInterpreter DevilDataType DevilVariable (name) DevilInteger DevilDouble DevilFloat Compiler

Compiler Implementation devil.g (function_def | statement ) statement – function statement and others. DevilWalker.g expr returns [ DevilDataType x ] { #(FUNC_CALL fname:ID params=get_var ) { interpreter.call_func(fname.getText(),params ); } }

Compiler Implementation Symbol Tables Global and Local ( Per Function ) Symbol Table for variables Stack of Symbol Tables per function while walking to handle scoping. Function Tables(Stores the Function AST) Main() Local Variables Function() called by Main() Local vars Innermost Function Variables

Conclusion Lessons Learnt compiler design. Good design is very important. Consult Teammates when in doubt. Always finish the hard part earlier.