DOC PREVIEW
Columbia COMS W4115 - DEVice Interface Language (DEVIL)

This preview shows page 1-2-3-4 out of 11 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

DEVice Interface Language (DEVIL)Boklyn Wong ([email protected])Pranay Wilson Tigga/Team Leader ([email protected])Vishal Kumar Singh ([email protected])Hye Seon Yi ([email protected])“A language that doesn't affect the way you think aboutprogramming is not worth knowing.”….. AnonymousChapter 2: Lexical Conventions2.1 CommentsThe character # introduces a comment. Everything on that line will be considered as a comment2.2 Identifiers Identifier is a sequence of letter and digit with first character must be letter. 2.3 KeywordsThe following identifiers are reserved for the language use and may not be used otherwise:ObjectBreakContinueuntilelsevolatilestaticautoifoptionswhiledefault tag entryrepeatintifcharrepeatexternoptionsregisterexterndonereturntemplatedone2.4 Separators( ) [ ] { } ; Separators which are IgnoredNewline \nTab \tCarriage \rWhite Space2.5 Types and VariablesStrong type controlled language. Mismatched types will not be automatically resolved or allowed by the compiler.1. Data Types- Integer: It is a sequence of digits.- Character: 1 character.- String: It is a sequence of characters separated by “ ”. However, It is also equivalent to array of characters. - Boolean: The Boolean type has two values, represented by the strings “true” and “false”.- Array: The Array contains any of the supported data types.- Object: This data type comprises of other data types and is used to abstractly represent real world entities like devices.2. VariablesEach variable is of type of one of the supported data type.A variable has a name (Identifier) and a Scope.The scope can be I. Global. II. Local.3. InitializationInteger to 0, character to ‘ ‘, String to NULL, Array to NULL.4. Conversions No conversion takes place from one type to another. Since the domain is Device configuration the control is in programmers/network administrators’ hand.e.g.Object FirewallDevicea=FirewallDevice,b = FirewallDevice.E.g. int a;e.g. string IPAddress;IPAddress = a.b.c.d;2.6 Operators, Declarations, Expressions, Statements and Blocks2.6.1 OperatorsThe following is the list of Operators in our language.< > <= >= == NOT+ - * / %++ -- AND OR:= @->>>1. Operator + : Addition2. Operator - : Subtraction3. Operator * : Multiplication 4. Operator / : Division 5. Operator % : remainder of division6. AND : Logical AND operation7. OR : Logical OR8. NOT : Not operation9. ++ : Increment10. -- : Decrement11. = : Assignment12. < : Less then13. > : Greater then14. <= : Less then equal to.15. >= : Greater then equal to. 16. == : equal to This is for inheritance kind of relationship among object.>> This is for composition kind of relationship among objects.The assignment operator can be used for object assignments which would result in creating a new object in memory and assignments of all values except the values which are volatile.The NOT operation is applicable only to Boolean type.Multiplication, Subtraction, Addition, Division, and Remainder is applicable only to integer types.The increment and decrement work on integer types only. Unary Operator: Logical negation: NOT NOT expression;Postfix increment: (x ++)Prefix increment: (++x)Postfix decrement: (x--)Prefix decrement: (--x)Relational Operators > Greater then < Lesser then >= greater then equal to <= lesser then equal to expression * expression expression + expression expression - expression expression / expression expression % expression expression++ expression-- ++expression --expressionexpression < expressionexpression > expressionexpression <= expressionexpression >= expressionexpression == expression NOT expressionIdentifier =expression-> is for inheritance of object>> is for composition of object.E.g.Object Router;Object Firewall;Object Port;Object LinuxRouter;Port p;Firewall a;Router r1;LinuxRouter r2;r2 -> r1 ;# means router r2 inherits non –volatile characteristics of r1.r2 >> a;# by doing this we make firewall a part of router r2 so configuration on this #device will automatically configure firewall too.Operator Precedence:NOTOR , AND*, /, % ,++ , --, + , - < , > , <= , >= , == =2.6.2 Declarations1. Object Type DeclarationDeclaration:Object Type_obj;Creates a copy of the type of object in memory. The object type must either be defined or should be available in library ( if supported).2. Object Instance CreationDeclaration:Type_obj instancename;Creates an instance by copying from original object which is used for type definition.3. Array CreationDeclarationType Identifier[ expr];4. Array IndexingReadIdentifier[expr];StoreIdentifier[expr] = expr; # AssignmentIndexing is used for storing and reading from Array position. If accessed position is null and error can be raised in runtime.2.6.3 Statements1. Expression StatementsMost statements are expressions.Statements are executed in sequence.Successful evaluation of expression completes the statements.2. Conditional StatementThere are 2 conditional statements1. if (condition) { statement }2. if (condition) {statement1 } else {statement2}The condition in above 2 statements is an evaluation of expression.The statement in 1 is executed if condition is “true”.The statement1 in 2 is executed if condition is “true” and statement2 is executed if condition is “false”.The else is connected to innermost if.3. Loop Statementwhile statement while (condition) statementCondition is evaluation of an expression. When the expression becomes “false” the loop exits.Repeat Until Statementrepeat statement until( condition);The statement is executed until condition becomes false.The difference between repeat-until and while statement is that in repeat-until the condition check occurs after the execution of statement whereas in while it happens before execution of statement.4. Break StatementThe statementbreak ;causes termination of the smallest enclosing loop statement.5. Return statementA function returns to the invoker by means of the return statement, which has following formsreturn ;return ( expression ) ;In the first case no value is returned. In the second case, the value of the expression is returned to the caller of the function.2.7 FunctionsThe form of function definition is described below.function_definition:return_type function_declaration


View Full Document

Columbia COMS W4115 - DEVice Interface Language (DEVIL)

Documents in this Course
YOLT

YOLT

13 pages

Lattakia

Lattakia

15 pages

EasyQL

EasyQL

14 pages

Photogram

Photogram

163 pages

Espresso

Espresso

27 pages

NumLang

NumLang

6 pages

EMPATH

EMPATH

14 pages

La Mesa

La Mesa

9 pages

JTemplate

JTemplate

238 pages

MATVEC

MATVEC

4 pages

TONEDEF

TONEDEF

14 pages

SASSi

SASSi

16 pages

JTemplate

JTemplate

39 pages

BATS

BATS

10 pages

Synapse

Synapse

11 pages

c.def

c.def

116 pages

TweaXML

TweaXML

108 pages

Load more
Download DEVice Interface Language (DEVIL)
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view DEVice Interface Language (DEVIL) and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view DEVice Interface Language (DEVIL) 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?