Introduction to AEL. Introduction to AEL. General AEL Structure. Language Specifics

Size: px
Start display at page:

Download "Introduction to AEL. Introduction to AEL. General AEL Structure. Language Specifics"

Transcription

1 Introduction to AEL Introduction to AEL Application Extension Language (AEL) is a general purpose programming language, modeled after the popular C programming language. AEL is used to configure, customize and extend the capabilities of the design environment. Like C, AEL has an extensive set of built-in function libraries, including functions for file input/output, math, string manipulation, list handling, and database query. In general, you can use AEL for these tasks: Organizing libraries and palettes of components. Defining the interface to new user-defined components. Creating new components with layout artwork. Defining custom layout artwork functions. Defining the interface to discrete-valued simulation components. Creating custom utility functions, such as parts list generators and bill of materials. Automating routine tasks, such as repetitive command sequences, batch analysis, or optimizations. For a table that shows where each function can be used, see Where to Use AEL Functions. Only a small subset of the language is used for component, library, or palette definitions. If you just want to customize a library or palette, you can skip the general language description and start at the section Using AEL for Library Definition. General AEL Structure The AEL language is similar to the C language in many ways. AEL is a procedural language, with many of the same language components as C, such as the use of variables and functions, arithmetic expressions, program flow, and logic statements. However, there are significant differences between AEL and the C language: AEL has no pre-processor; therefore, the #if, #ifdef, #ifndef, #endif, #define, #undef and #include directives are not supported. However, AEL files can reference other AEL files using the load() function, which has an effect similar to #include. Variables, pass parameters and function return values are not typed; therefore, the C keywords int, char, float, double, long, short, unsigned, auto, register, and typedef are not supported. Although a value has a particular type, the type of a variable, pass parameter, or function return is dependent only on the most recently associated value, not on the declaration of the variable, parameter, or function. Supported values are long, double, string, and boolean. AEL also supports complex numbers and lists which are not supported by C. AEL does not support structures or unions which are part of standard C, nor does it support external or static variables. All variables defined outside of a function are global. Variables can be declared globally (outside a function definition), local to a function, or declared within a compound statement. AEL supports a large subset of the C operators and logic and control constructs. However, AEL does not support the right arrow (->) and period (.). Brackets ([ ]) are supported for list access only. For example: a=list("yes", "no") b=[0] - "yes" b=[1] - "no" The switch, case, and default logic and control constructs are supported. AEL does not support casting; however, there are several type conversion functions. AEL features automatic garbage collection, a language feature that automatically re-claims storage when it is no longer needed. If you are unfamiliar with the C language, refer to The C Programming Language by Kernighan and Ritchie. Language Specifics The AEL language can be described in terms of the six classes of tokens: comments, identifiers, keywords, constants, operators, and other separators. Like the C language, blanks, tabs, new lines, and comments are ignored except as separators for other tokens.

2 Comments The characters /* or // introduce a comment. If the characters /* are used, the comment ends with the next occurrence of the characters */. If the characters // are used, the comment continues to the end of the line. Naming Convention for Variables Letter b c d f h i r s Variable Type Boolean Complex Double Float Handle Integer Real String Lists All lists are 0 based, starting at 0, not 1. Identifiers An identifier is a sequence of letters, digits, and underscore, where the first character must not be a digit. Case is significant for identifiers. There is no limit to the length of an identifier. Identifiers are used to represent function names, variable names, or statement labels. Keywords These identifiers are reserved for use as keywords: Keyword break continue decl defun do else for goto if NULL return while _ FILE LINE_ Description leave a loop, exit switch statement start next iteration of a loop define a variable define a function begin a do {} while (); loop begin alternate action of an if()-conditional or of an inline if()-then-else conditional begin for ( ;; ) loop goto a labelled statement begin if() conditional constant NULL return from a function begin while(){} loop, or end do{} while(); loop current filename current line number

3 default switch defines default case for switch(){} statement begin a switch (){} statement case defines a case 1A switch (){case: } elseif then AND OR EQUALS NOT list begin alternate if() conditional to an if() conditional defines the action for inline if() then else statements logical and logical or logical equal operator logical not define a list Constants AEL supports two constant forms not supported by C: the null value and the imaginary number. These constants represent internal data types not found in C. The list is also an internal data type, but there is no constant expression for a list. The supported forms of constants are: Supported Constant null value Description NULL decimal integer constant 13 hexadecimal integer constant 0x3E (case is not significant) octal integer constant 0377 string constant real number constant imaginary number constant "a string" 10.3 or 25.4e-3 (case is not significant) 3.5i or 4+3.5i A string constant consists of one or more characters enclosed in quotation marks (" "). Unlike C, AEL does not allow you to treat strings as arrays of characters. A string constant can have embedded non-printable characters, expressed using the backslash: Non-Printable Character Description \n new line \r return \f form feed \b backspace \t tab \" double quote \ \ backslash \xnn character in hexadecimal notation (N is 0-9 or A - F; case is not significant) \0NNN character in octal notation (N is 0-7) If you do not want to convert control characters, use 2 single quotes around the string instead of quotation marks; for example: '' \usr\ dsn\nim.dsn ''. Predefined Global Constants To simplify the use of the database query functions, a set of symbolic constants, called global variables, have been predefined. The global boolean definitions are: TRUE, FALSE. Other global variables are shown with the applicable function definition.

4 Global Variable TRUE FALSE stdin stdout stderr Definition boolean true boolean false standard in standard out standard error hugereal 3.4e +38 tinyreal 2.2e -308 e ln10 ln(10) c0 e0 u0 boltzmann qelectron planck speed of light e+08 m/s vacuum permittivity e-12 F/m vacuum permittivity e-06 H/m Boltzmann's constant e-23 J/K charge of an electron e-19 C Planck's constant e-34 J-sec PI = pi = on_pc TRUE if running on PC, else FALSE that literally thousands of functions and global variables are defined in the Advanced Design System Design Environment (DE). To ensure that your functions and global variables do not interfere with those provided in the program, you should add a special prefix to your functions and variables. Further, different setups or users at your site should use unique definitions to distinguish newly-created sets of functions and variables (such as, by using a special prefix). For example: mc1_varname mimic_abc Caution Do not use a dollar sign ( $ ) as a special operator, since this character is used in expressions. 2pi is not equal to 2 * pi. 2pi is interpreted as 2 scale factor p for pico and i for imaginary part (= 2.000E-12). Operators Constants and identifiers can be combined, by using operators, to form expressions. Expressions can be combined again, by using operators, to form more complex expressions. Expressions are the building blocks of AEL. Expressions can be used in assignments to variables and passed as parameters when calling AEL functions. AEL expressions are described and evaluated in the same way as in the C language, where operators are applied in order of their precedence. As with C, the default precedence applied in evaluating an expression can be overridden by grouping operands with parentheses. The following table lists (by operator precedence) the mathematical operators that are recognized in expressions. Mathematical Operators by Operator Precedence Operator Description () Expression grouping! Logical NOT (unary) ~ Bitwise one's complement (unary) ++ Pre- and post-increment operator - Pre- and post-decrement operator - Negates a value (unary) * Used preceding an identifier to calculate value stored at an address (unary) & Used preceding an identifier to specify address of a variable (unary)

5 % Integer remainder after division (modulus) / Division + Addition - Subtraction >= Test for first value greater than or equal to second <= Test for first value less than or equal to second > Test for first value greater than second < Test for first value less than second == Test for equal values!= Test for not equal values & ^ Bitwise AND Bitwise exclusive OR Bitwise inclusive OR && Logical AND Logical OR?: Conditional evaluation operator (a ternary operator) = Assignment operator *= Multiplication assignment operator /= Division assignment operator %= Integer remainder assignment operator += Addition assignment operator ^= Bitwise exclusion or assignment operator = Subtraction assignment operator = OR assignment operator &= AND assignment operator << Bitwise left shift >> Bitwise right shift <<= Left shift assignment operator >>= Right shift assignment operator, Sequential evaluation operator ** Power operator :: Used to define sequences; for example, 1::10 or 1::10::2 $ Indicates substituting the variable for its value AND OR Logical AND Logical OR EQUALS Test for equal values (same as ==) NOT Logical NOT. Apply this operation to all elements of the array operand. See the following section The Apply-to-All-Elements (.) Math Operator. Operators which have one operand are called unary operators. These include!, ~, ++,,, *, and &. The operand follows the operator except for ++ and. The operator follows the operand in the post-increment and post-decrement use of ++ and. Unlike C, the unary * and & operators can be used only with identifiers. However, they generate the address or dereference an address much like C does. Binary operators have two operands which are separated by the operator. Most of the operators fall into this category. Most of the binary operators perform mathematical operations on real numbers, but there are a few exceptional operators. The operators!, &&, and work with the logical values. The operands are tested for the values TRUE and FALSE, and the result of the operation is either TRUE or FALSE. In AEL a logical test of a value is TRUE for non-zero numbers or strings with non-zero length, and FALSE for 0.0 (real),

6 0 (integer), NULL or empty strings. that the right hand operand of && is only evaluated if the left hand operand tests TRUE, and the right hand operand of is only evaluated if the left hand operand tests FALSE. The operators >=, <=, >, <, ==,!=, AND, OR, EQUALS, and NOT EQUALS also produce logical results, producing a logical TRUE or FALSE upon comparing the values of two expressions. These operators are most often used to compare two real numbers or integers. These operators operate differently in AEL than C with string expressions in that they actually perform the equivalent of strcmp() between the first and second operands, and test the return value against 0 using the specified operator. The operators ~, &, ^,, <<, and >> are considered bitwise operators and work only with integers, manipulating the binary bits of the value. There are several assignment operators: =, +=, -=. *=, /=, %=, ^=, =, &=, <<=, and >>=. These operators always have an identifier as the left hand operand, and modify the value of the variable as well as returning its value after modification. Multiple assignments are supported (e.g., a=b=4) which evaluate right to left. As in C, there is only one ternary operator, the conditional evaluation operator, which has the form: expression? expression : expression This operator evaluates the first expression and tests it. If the value of the first expression is zero it evaluates the third expression, and if not zero it evaluates the second expression. An expression can also be a function call, which takes the following form: identifier( argument_list ) The identifier is the name of the function and argument_list is a list of comma separated expressions representing the values of the parameters passed to the function. The function can return a value for use as an operand in evaluating additional expressions. The sequential evaluation operator is used to cause several comma separated expressions to be evaluated in left-to-right order, with only the last value returned. The Apply-to-All-Elements (.) Math Operator Any math operator prefixed by a "." (for example,.*.+./.-) applies the following operation to all elements of the array operand or a dataset data operand. If one operand is an array/dataset data operand and the other is a single value, the single value and the operation will be executed on every element of the array/dataset data operand, thereby creating a new array/dataset data variable. If both operands are arrays/dataset data operands, then their dimensions are ensured to be the same, and each element of the array/dataset data operand is operated on the element in the same position in the other array/dataset data operand. A new array/dataset data variable is created of the same size with the new values. Other Separators In addition to the operators, several other separators are used in AEL to form statements: Separator Description ; Terminates an AEL statement. : Terminates an identifier to define a statement label. {} Groups one or more statements together to form a compound statement. Variables declared within braces are defined only within the scope of the braces. Building AEL Programs AEL programs consist of a sequence of one or more of the following forms of AEL statements: Comment Simple statement Compound statement Variable declaration Function definition Control and logic statements

7 Comment Comments are allowed anywhere, as long as the contents of the comment are not required to complete a statement or function definition. Comments begin with // or /*. In the first case, the comment continues to the end of the line, and in the second case the comment ends with */. // single line comment /* multi-line comment */ Simple Statement A simple AEL statement is an AEL expression terminated by a semicolon ( ; ) where the resulting value of the expression is discarded. Expressions often have side effects caused by evaluation which can be more important than the resulting value. Some examples of simple AEL statements are: AEL Statement Description a=5; Value of a is set to 5 my_fun( 1, 2 ); Function my_fun is called, with the values 1 and 2 passed as parameters, return value of the function is discarded b++; Value of b is incremented by one Compound Statement A compound statement is several statements grouped together inside braces { }. Any type of statement can be contained in a compound statement. Compound statements are used to define the body of a function, switch statement, or the action of a conditional or loop statement. Variable Declaration The keyword decl begins a variable declaration, followed by a comma-separated identifier list, and terminated by a semicolon. Each identifier can be given an initial value using the = assignment operator. An example of a variable declaration is: decl a, b=5, cosa=cos(a); A variable declaration without an initial value has the value NULL. A variable can be declared more than once, in which case the first declaration prevails and the identity of the variable is maintained through subsequent declarations. If a variable is declared with an initial value, the 2nd declaration prevails. That is, if a global variable is re-declared and initialized, then the global variable writes over the previous value; if the global variable is declared but is not initialized, the previous value is retained. A variable declaration outside of a function definition is considered global. Inside a function definition a variable is considered local to the function. Variable declarations contained inside a compound statement are hidden from expressions outside the compound statement. AEL Lists Declaration and Initialization of an AEL List: An AEL list is a collection of AEL values. It is created by: list(<val1>, <val2>, etc...); where <valx> is any valid AEL value, including another AEL list. Printing Lists: The value of a list can be printed using the identify_value() function. See List Management Functions for documentation on traversing lists and other operations on lists.

8 Function Definitions The general form of a function definition is: The keyword defun begins a function definition. The name of the function is the identifier. The parameter_list is a list of comma-separated identifiers defining the parameters of the functions. A return statement (consisting of a return keyword optionally followed by an expression and terminated by a semicolon) ends the function and specifies the return value. All AEL functions return a value. If the return statement is missing or no value was given for the return statement, the return value is NULL. If a function returning a NULL value is used in the context of an expression, the evaluation of the expression can fail, causing an AEL error. AEL functions must be defined before they can be called. Control and Logic Statements AEL supports many of the C control and logic capabilities. The control and logic statements which can be used are: goto label; if (expression) block else if (expression) block else block for (statement; expression; statement) block do block while (expression); while (expression) block switch (expression) {case statements} where: label is a defined statement label; expression is a combination of values, functions, and operators evaluating to a single value; statement is also a single expression where the value is discarded; and block is a single statement, or several statements enclosed in braces. If goto is used within a function definition, the label must be defined in the same function definition. Switch and case statements are the same as case statements in C language. AEL Arrays Declaration and Initialization AEL supports multidimensional arrays. An array must be initialized in a declaration or in an assignment statement. The number of elements in the initialization statement MUST be the same as the loop. You can initialize an array to one element, and then resize it later using the resize_array() function. In AEL arrays, {} and [] are treated the same. If you are using data from datasets, {} is a row vector and [] is a column vector. Array elements are separated by ",". Array elements can be integers, doubles, or complex numbers. Sequences can also be used to initialize an integer or double array. When specifying values in a dimension, you can use the following inside of either {}'s or []'s: scalar values separated by commas a sequence a sequences with steps If you are specifying an array with more than one dimension, you can specify an inner dimension WITHOUT using {}'s or []'s by using a ";" to

9 separate the dimensions. Examples: Row vectors or one dimensional array: decl x = {1+3i, 4-5i, 9+3i, 10i}; This array consists of the following elements: x[0] = 1+3i x[1] = 4-5i x[2] = 9+3i x[3] = 0+10i x = [1+3i, 4-5i, 9+3i, 10i]; This array consists of the following elements: x[0] = 1+3i x[1] = 4-5i x[2] = 9+3i x[3] = 0+10i x = {1::10) This array shows initializing with a sequence and consists of the following elements: x[0] = 1 x[1] = 2 x[2] = 3 x[4] = 4 x[5] = 5... x[9] = 10 x = {1::0.5::2) This array shows initializing with a sequence and a step (how much to increment) and consists of the following elements: x[0] = 1 x[1] = 1.5 x[2] = 2 Column vector or two dimensional array with row dimension being 0: Both examples produce the same array and consists of the following elements: z[0] = {1} (one dimensional array) z[1] = {2} z[2] = {3} z[0,0] = 1 (scalar values) z[1,0] = 2 z[2,0] = 3 Matrix or a two dimensional array: Both examples produce the same array and consists of the following elements: y[0] = {1,2} (one dimensional array) y[1] = {3,4} y[2] = {5,6} y[3] = {7,8} y[0,0] = 1 (scalar values) y[0,1] = 2 y[1,0] = 3 y[1,1] = 4 y[2,0] = 5 y[2,1] = 6 y[3,0] = 7 y[3,1] = 8 Three dimensional array:

10 Both examples produce the same array and consists of the following elements: s[0] = 0,1},{2,3 (two dimensional array) s[1] = 4,5},{6,7 s[0,0] = {0,1} (one dimensional array) s[0,1] = {2,3} s[1,0] = {4,5} s[1,1] = {6,7} s[0,0,0] = 0 (scalar values) s[0,0,1] = 1 s[0,1,0] = 2 s[0,1,1] = 3 s[1,0,0] = 4 s[1,0,1] = 5 s[1,2,0] = 6 s[1,1,1] = 7 Printing Arrays The value of an array can be printed using the identify_value() function. Operations Between Arrays Some operations on a whole array can be executed. These include assignments, additions, subtraction, multiplication (which is essentially matrix multiplication), division, and negation. When assignments are made, the receiver of the assignment will point to the same array as the original array. However, when a modification is made to an array, a new array is created so that other variables pointing to that array will not be modified. This is a significant difference between AEL arrays and C arrays. When addition or subtraction is executed between whole arrays, the math is executed one element at a time. Therefore, the array bounds must be exactly the same. Element by element multiplication, division and power are also supported by using the operators:.,./, and.*. When multiplication is executed between whole arrays, matrix multiplication is executed. Therefore, the arrays must be 2 dimensional and the array bounds must be compatible for matrix multiplication, which is row1 x col1 * row2 x col2 where the dimension of col1 must equal the dimension of row2. The new array will have the dimensions row1 x col2; that is, 4 x 2 * 2 x 8 = 4 x 8. Currently, the following short hand notations are supported: +=, -=, *=. Operations Between Scalar and Arrays Any math operation between an array and scalar values is legal. The result of such expressions is an array.

11 Transpose Transposition of arrays is supported. The syntax is: Access and Operations on Array Elements Individual elements are accessed by specifying the array name followed by the index(s) enclosed in square brackets "[]". There are three ways to access elements of multidimensional arrays: The indices can be separated by commas and the whole sequence enclosed in square brackets; for example, y[1,3] Each index can be enclosed in square brackets; for example, y[1][3] An index can be an AEL sequence; for example, y[1::3] When individual elements are accessed, they are treated as any other scalar variable. That is they can be assigned, printed, parameters, or simply accessed. that the indices begin with 0. Looping It is possible to loop with for and while statements, like in C. The first three examples below will print out The 4th example prints out For Loop Example While Loop Example While Loop Example While Loop with Continue Example AEL Array Functions (Used in AEL Scripts) The AEL array functions used in AEL scripts are: offset_array(), resize_array(), array_size(), array_type(), array_lowerbound(), array_upperbound(), and convert_array(). Writing, Loading and Testing AEL Functions For component and artwork definitions, you can refer to the AEL files supplied with the program. These files, which define the entire element sets for each simulator, contain hundreds of examples. The files are located in the installation directory for your application: $HPEESOF_DIR/circuit/ael (for Analog/Rf applications) $HPEESOF_DIR/adsptolemy/ael (for Signal Processing applications) $HPEESOF_DIR/de/ael (for the Design Environment, all applications) You can use any text editor to write AEL files.

12 There is a special procedure to install an AEL file so that the functions defined in the file can be used in a circuit simulation. Refer to Intr oduction to Measurement Expressions for more information. Playing an AEL Macro In the ADS Main window, you can replay an AEL macro using the Tools > Playback Macro command. You can execute AEL statements interactively by typing the statement in the Tools > Command Line dialog box. For example, the first value in a list could be examined by typing: fputs(stderr, car(list(1,2,3))); The value 1 would be displayed in stderr. Loading AEL Files You can load AEL files by executing the load() command, either from the Command Line dialog box or as a statement in an AEL file. For example: load("myfunc.ael"); Any number of functions can be declared in a single AEL file and any function in the loaded file can then be executed by entering the function name and parameters. For example: testit(1,2, "myfunc"); You can load AEL files automatically when you start the program in one of these ways: By adding the name of the file containing the functions to one of the configuration variables LOCAL_AEL or USER_AEL and specifying the path to the file in the AEL_PATH variable. LOCAL_AEL is a project-specific variable that is reloaded every time a project is loaded (once per project). USER_AEL is a user-specific variable that is loaded once per program session (once per user). For details on configuring these variables, refer to Customizing the ADS Environment. By using the -m option; for example, ads -m startup.ael. By placing the file in the networks subdirectory of a project, which automatically loads the file when opening the project. When files are loaded automatically by the program, these files are also compiled automatically. Any file loaded is re-compiled if it is modified or if its compiled version does not exist. Compiling greatly increases the speed in which the function is loaded and it also performs a simplified syntax check. When creating AEL files, you can perform a quick check of their syntax by pre-compiling the AEL file. For details on manually compiling AEL files, refer to the section Using the AEL Compiler. Testing AEL Functions You can test most functions by loading the AEL file from the Command Line dialog box. Debugging of the program is limited to adding fputs() and f printf() statements in the file to determine function values and code execution. When using fputs() and fprintf() statements be sure to direct the fput s() and fprintf() output to standard error, stderr, or to a file, since stdout is used by the project design environment to communicate with other programs. On UNIX, the results of an fputs() or fprintf() statement sent to stderr will be displayed in the terminal window that the program was started in. On a PC, the program needs to be started as follows: ads -d daemon.log This command opens the program with a window that contains all debugging statements and the results of fputs() and fprintf() statements sent to stderr. On UNIX, this method creates a logging file called daemon.log. For example, to see something print to a UNIX terminal or PC window: In the Main window, choose Tools > Command Line. In the dialog, type: fputs(stderr, "hello world!"); Click Apply. AEL Loading Context When an AEL file is loaded, functions and variable references are resolved according to the loading context, which specifies the AEL vocabulary to search. New definitions in the AEL file are also added to the context vocabulary.

13 CmdOp and SimCmd Loading Contexts The Advanced Design System contains two important contexts, called SimCmd and CmdOp. When AEL files are loaded at program start-up or when you enter AEL from the Command Line, the context is CmdOp. When the dialog callbacks are invoked, the context is SimCmd. SimCmd is a superset of CmdOp; that is, when the context is SimCmd, all of the definitions in CmdOp are accessible. But when the context is CmdOp, the definitions in SimCmd cannot be accessed and fail with the message: "could not find global word". An AEL file that contains new AEL functions or variables can be loaded automatically at program start up. The functions or variables are then accessible from the Command Line and menu commands. The default loading context is CmdOp, which is also the context in which all AEL definitions in ADS get loaded. The normal context for project's networks.ael files is a project-specific context. This context is a superset of SimCmd. When the definitions in the file must be accessed while running the program, the context must be CmdOp. The default loading context can be overwritten by specifying the optional second argument (the context name) for the load() function. This can be specified when loading the AEL file from another startup AEL file, or from the command line. For example, to load an AEL file "test" in the SimCmd, you can use the following load command: load ("test", "SimCmd"); The loading context within a particular AEL file can be fixed using the AEL directive #voc(). The argument to #voc() specifies the new loading context. If no argument is specified, the loading context is reset to the default for the file. The loading context fixed using #voc() overrides that set by the load() function. For example, when placed in an AEL file that is loaded in the CmdOp context, #voc(simcmd) causes the lines in the AEL file following it to be loaded in SimCmd context. When a #voc() directive is encountered, or the end of file is reached, the loading context reverts back to CmdOp. Using the AEL Compiler When creating AEL functions, you can pre-compile the AEL file by using the AEL compiler, aelcomp, in a stand-alone mode. Any errors in syntax are reported by the compiler and a compiled atf AEL file is produced. The compiler is invoked automatically by the Design Environment whenever an AEL file is loaded that has been modified since the last compile or is missing its compiled atf counterpart. To run the AEL compiler, enter the following instruction at the command line: aelcomp <input>.ael <output>.atf The input file and output file names are required and must be specified with their extensions. Normally, the extensions ael and atf are used for the input and output files, respectively. Aelcomp has one option, -version, which prints out version info on aelcomp itself. To use this option at the command line, type aelcomp -version On UNIX, you must set the shared library path before you run the AEL compiler. Using a bourne shell (sh) or k shell (ksh), enter the following at the command line to set the shared library path: Customizing the Parts List The Parts List command has extensive customization capability using AEL function calls. To configure the Pick and Place Options, simply modify the routines called each time a Pick and Place Report is generated. These routines are located in the de_parts.ael file located in your program installation directory under de/ael. Parts List Example Using an AEL Macro In this example, the AEL macro traverses the database to query information about a design and generates a simple parts list ( Parts List Example). To run the macro enter this instruction at the command line: plist(); Parts List Example

14

1 Lexical Considerations

1 Lexical Considerations Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Spring 2013 Handout Decaf Language Thursday, Feb 7 The project for the course is to write a compiler

More information

Review of the C Programming Language for Principles of Operating Systems

Review of the C Programming Language for Principles of Operating Systems Review of the C Programming Language for Principles of Operating Systems Prof. James L. Frankel Harvard University Version of 7:26 PM 4-Sep-2018 Copyright 2018, 2016, 2015 James L. Frankel. All rights

More information

UNIT- 3 Introduction to C++

UNIT- 3 Introduction to C++ UNIT- 3 Introduction to C++ C++ Character Sets: Letters A-Z, a-z Digits 0-9 Special Symbols Space + - * / ^ \ ( ) [ ] =!= . $, ; : %! &? _ # = @ White Spaces Blank spaces, horizontal tab, carriage

More information

EDIABAS BEST/2 LANGUAGE DESCRIPTION. VERSION 6b. Electronic Diagnostic Basic System EDIABAS - BEST/2 LANGUAGE DESCRIPTION

EDIABAS BEST/2 LANGUAGE DESCRIPTION. VERSION 6b. Electronic Diagnostic Basic System EDIABAS - BEST/2 LANGUAGE DESCRIPTION EDIABAS Electronic Diagnostic Basic System BEST/2 LANGUAGE DESCRIPTION VERSION 6b Copyright BMW AG, created by Softing AG BEST2SPC.DOC CONTENTS CONTENTS...2 1. INTRODUCTION TO BEST/2...5 2. TEXT CONVENTIONS...6

More information

Lexical Considerations

Lexical Considerations Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Fall 2005 Handout 6 Decaf Language Wednesday, September 7 The project for the course is to write a

More information

Object oriented programming. Instructor: Masoud Asghari Web page: Ch: 3

Object oriented programming. Instructor: Masoud Asghari Web page:   Ch: 3 Object oriented programming Instructor: Masoud Asghari Web page: http://www.masses.ir/lectures/oops2017sut Ch: 3 1 In this slide We follow: https://docs.oracle.com/javase/tutorial/index.html Trail: Learning

More information

Lexical Considerations

Lexical Considerations Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Spring 2010 Handout Decaf Language Tuesday, Feb 2 The project for the course is to write a compiler

More information

Fundamental of Programming (C)

Fundamental of Programming (C) Borrowed from lecturer notes by Omid Jafarinezhad Fundamental of Programming (C) Lecturer: Vahid Khodabakhshi Lecture 3 Constants, Variables, Data Types, And Operations Department of Computer Engineering

More information

Operators. Java operators are classified into three categories:

Operators. Java operators are classified into three categories: Operators Operators are symbols that perform arithmetic and logical operations on operands and provide a meaningful result. Operands are data values (variables or constants) which are involved in operations.

More information

UNIT - I. Introduction to C Programming. BY A. Vijay Bharath

UNIT - I. Introduction to C Programming. BY A. Vijay Bharath UNIT - I Introduction to C Programming Introduction to C C was originally developed in the year 1970s by Dennis Ritchie at Bell Laboratories, Inc. C is a general-purpose programming language. It has been

More information

Review of the C Programming Language

Review of the C Programming Language Review of the C Programming Language Prof. James L. Frankel Harvard University Version of 11:55 AM 22-Apr-2018 Copyright 2018, 2016, 2015 James L. Frankel. All rights reserved. Reference Manual for the

More information

Language Reference Manual simplicity

Language Reference Manual simplicity Language Reference Manual simplicity Course: COMS S4115 Professor: Dr. Stephen Edwards TA: Graham Gobieski Date: July 20, 2016 Group members Rui Gu rg2970 Adam Hadar anh2130 Zachary Moffitt znm2104 Suzanna

More information

DEPARTMENT OF MATHS, MJ COLLEGE

DEPARTMENT OF MATHS, MJ COLLEGE T. Y. B.Sc. Mathematics MTH- 356 (A) : Programming in C Unit 1 : Basic Concepts Syllabus : Introduction, Character set, C token, Keywords, Constants, Variables, Data types, Symbolic constants, Over flow,

More information

ME 461 C review Session Fall 2009 S. Keres

ME 461 C review Session Fall 2009 S. Keres ME 461 C review Session Fall 2009 S. Keres DISCLAIMER: These notes are in no way intended to be a complete reference for the C programming material you will need for the class. They are intended to help

More information

Work relative to other classes

Work relative to other classes Work relative to other classes 1 Hours/week on projects 2 C BOOTCAMP DAY 1 CS3600, Northeastern University Slides adapted from Anandha Gopalan s CS132 course at Univ. of Pittsburgh Overview C: A language

More information

C Language Part 1 Digital Computer Concept and Practice Copyright 2012 by Jaejin Lee

C Language Part 1 Digital Computer Concept and Practice Copyright 2012 by Jaejin Lee C Language Part 1 (Minor modifications by the instructor) References C for Python Programmers, by Carl Burch, 2011. http://www.toves.org/books/cpy/ The C Programming Language. 2nd ed., Kernighan, Brian,

More information

C OVERVIEW BASIC C PROGRAM STRUCTURE. C Overview. Basic C Program Structure

C OVERVIEW BASIC C PROGRAM STRUCTURE. C Overview. Basic C Program Structure C Overview Basic C Program Structure C OVERVIEW BASIC C PROGRAM STRUCTURE Goals The function main( )is found in every C program and is where every C program begins speed execution portability C uses braces

More information

LESSON 1. A C program is constructed as a sequence of characters. Among the characters that can be used in a program are:

LESSON 1. A C program is constructed as a sequence of characters. Among the characters that can be used in a program are: LESSON 1 FUNDAMENTALS OF C The purpose of this lesson is to explain the fundamental elements of the C programming language. C like other languages has all alphabet and rules for putting together words

More information

Unit-II Programming and Problem Solving (BE1/4 CSE-2)

Unit-II Programming and Problem Solving (BE1/4 CSE-2) Unit-II Programming and Problem Solving (BE1/4 CSE-2) Problem Solving: Algorithm: It is a part of the plan for the computer program. An algorithm is an effective procedure for solving a problem in a finite

More information

C OVERVIEW. C Overview. Goals speed portability allow access to features of the architecture speed

C OVERVIEW. C Overview. Goals speed portability allow access to features of the architecture speed C Overview C OVERVIEW Goals speed portability allow access to features of the architecture speed C fast executables allows high-level structure without losing access to machine features many popular languages

More information

A Fast Review of C Essentials Part I

A Fast Review of C Essentials Part I A Fast Review of C Essentials Part I Structural Programming by Z. Cihan TAYSI Outline Program development C Essentials Functions Variables & constants Names Formatting Comments Preprocessor Data types

More information

Features of C. Portable Procedural / Modular Structured Language Statically typed Middle level language

Features of C. Portable Procedural / Modular Structured Language Statically typed Middle level language 1 History C is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell Labs. C was originally first implemented on the DEC

More information

INTRODUCTION 1 AND REVIEW

INTRODUCTION 1 AND REVIEW INTRODUTION 1 AND REVIEW hapter SYS-ED/ OMPUTER EDUATION TEHNIQUES, IN. Programming: Advanced Objectives You will learn: Program structure. Program statements. Datatypes. Pointers. Arrays. Structures.

More information

Character Set. The character set of C represents alphabet, digit or any symbol used to represent information. Digits 0, 1, 2, 3, 9

Character Set. The character set of C represents alphabet, digit or any symbol used to represent information. Digits 0, 1, 2, 3, 9 Character Set The character set of C represents alphabet, digit or any symbol used to represent information. Types Uppercase Alphabets Lowercase Alphabets Character Set A, B, C, Y, Z a, b, c, y, z Digits

More information

Chapter 2. Lexical Elements & Operators

Chapter 2. Lexical Elements & Operators Chapter 2. Lexical Elements & Operators Byoung-Tak Zhang TA: Hanock Kwak Biointelligence Laboratory School of Computer Science and Engineering Seoul National Univertisy http://bi.snu.ac.kr The C System

More information

CGS 3066: Spring 2015 JavaScript Reference

CGS 3066: Spring 2015 JavaScript Reference CGS 3066: Spring 2015 JavaScript Reference Can also be used as a study guide. Only covers topics discussed in class. 1 Introduction JavaScript is a scripting language produced by Netscape for use within

More information

Reserved Words and Identifiers

Reserved Words and Identifiers 1 Programming in C Reserved Words and Identifiers Reserved word Word that has a specific meaning in C Ex: int, return Identifier Word used to name and refer to a data element or object manipulated by the

More information

The Warhol Language Reference Manual

The Warhol Language Reference Manual The Warhol Language Reference Manual Martina Atabong maa2247 Charvinia Neblett cdn2118 Samuel Nnodim son2105 Catherine Wes ciw2109 Sarina Xie sx2166 Introduction Warhol is a functional and imperative programming

More information

TED Language Reference Manual

TED Language Reference Manual 1 TED Language Reference Manual Theodore Ahlfeld(twa2108), Konstantin Itskov(koi2104) Matthew Haigh(mlh2196), Gideon Mendels(gm2597) Preface 1. Lexical Elements 1.1 Identifiers 1.2 Keywords 1.3 Constants

More information

Full file at

Full file at Java Programming: From Problem Analysis to Program Design, 3 rd Edition 2-1 Chapter 2 Basic Elements of Java At a Glance Instructor s Manual Table of Contents Overview Objectives s Quick Quizzes Class

More information

2 nd Week Lecture Notes

2 nd Week Lecture Notes 2 nd Week Lecture Notes Scope of variables All the variables that we intend to use in a program must have been declared with its type specifier in an earlier point in the code, like we did in the previous

More information

A flow chart is a graphical or symbolic representation of a process.

A flow chart is a graphical or symbolic representation of a process. Q1. Define Algorithm with example? Answer:- A sequential solution of any program that written in human language, called algorithm. Algorithm is first step of the solution process, after the analysis of

More information

Chapter 3: Operators, Expressions and Type Conversion

Chapter 3: Operators, Expressions and Type Conversion 101 Chapter 3 Operators, Expressions and Type Conversion Chapter 3: Operators, Expressions and Type Conversion Objectives To use basic arithmetic operators. To use increment and decrement operators. To

More information

UNIT IV 2 MARKS. ( Word to PDF Converter - Unregistered ) FUNDAMENTALS OF COMPUTING & COMPUTER PROGRAMMING

UNIT IV 2 MARKS. ( Word to PDF Converter - Unregistered )   FUNDAMENTALS OF COMPUTING & COMPUTER PROGRAMMING ( Word to PDF Converter - Unregistered ) http://www.word-to-pdf-converter.net FUNDAMENTALS OF COMPUTING & COMPUTER PROGRAMMING INTRODUCTION TO C UNIT IV Overview of C Constants, Variables and Data Types

More information

Lecture 3. More About C

Lecture 3. More About C Copyright 1996 David R. Hanson Computer Science 126, Fall 1996 3-1 Lecture 3. More About C Programming languages have their lingo Programming language Types are categories of values int, float, char Constants

More information

Basic operators, Arithmetic, Relational, Bitwise, Logical, Assignment, Conditional operators. JAVA Standard Edition

Basic operators, Arithmetic, Relational, Bitwise, Logical, Assignment, Conditional operators. JAVA Standard Edition Basic operators, Arithmetic, Relational, Bitwise, Logical, Assignment, Conditional operators JAVA Standard Edition Java - Basic Operators Java provides a rich set of operators to manipulate variables.

More information

Computers Programming Course 6. Iulian Năstac

Computers Programming Course 6. Iulian Năstac Computers Programming Course 6 Iulian Năstac Recap from previous course Data types four basic arithmetic type specifiers: char int float double void optional specifiers: signed, unsigned short long 2 Recap

More information

Objectives. Chapter 2: Basic Elements of C++ Introduction. Objectives (cont d.) A C++ Program (cont d.) A C++ Program

Objectives. Chapter 2: Basic Elements of C++ Introduction. Objectives (cont d.) A C++ Program (cont d.) A C++ Program Objectives Chapter 2: Basic Elements of C++ In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types Discover how a program evaluates

More information

Chapter 2: Basic Elements of C++

Chapter 2: Basic Elements of C++ Chapter 2: Basic Elements of C++ Objectives In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types Discover how a program evaluates

More information

BoredGames Language Reference Manual A Language for Board Games. Brandon Kessler (bpk2107) and Kristen Wise (kew2132)

BoredGames Language Reference Manual A Language for Board Games. Brandon Kessler (bpk2107) and Kristen Wise (kew2132) BoredGames Language Reference Manual A Language for Board Games Brandon Kessler (bpk2107) and Kristen Wise (kew2132) 1 Table of Contents 1. Introduction... 4 2. Lexical Conventions... 4 2.A Comments...

More information

The SPL Programming Language Reference Manual

The SPL Programming Language Reference Manual The SPL Programming Language Reference Manual Leonidas Fegaras University of Texas at Arlington Arlington, TX 76019 fegaras@cse.uta.edu February 27, 2018 1 Introduction The SPL language is a Small Programming

More information

Chapter 2: Basic Elements of C++ Objectives. Objectives (cont d.) A C++ Program. Introduction

Chapter 2: Basic Elements of C++ Objectives. Objectives (cont d.) A C++ Program. Introduction Chapter 2: Basic Elements of C++ C++ Programming: From Problem Analysis to Program Design, Fifth Edition 1 Objectives In this chapter, you will: Become familiar with functions, special symbols, and identifiers

More information

Typescript on LLVM Language Reference Manual

Typescript on LLVM Language Reference Manual Typescript on LLVM Language Reference Manual Ratheet Pandya UNI: rp2707 COMS 4115 H01 (CVN) 1. Introduction 2. Lexical Conventions 2.1 Tokens 2.2 Comments 2.3 Identifiers 2.4 Reserved Keywords 2.5 String

More information

A complex expression to evaluate we need to reduce it to a series of simple expressions. E.g * 7 =>2+ 35 => 37. E.g.

A complex expression to evaluate we need to reduce it to a series of simple expressions. E.g * 7 =>2+ 35 => 37. E.g. 1.3a Expressions Expressions An Expression is a sequence of operands and operators that reduces to a single value. An operator is a syntactical token that requires an action be taken An operand is an object

More information

C++ Programming Basics

C++ Programming Basics C++ Programming Basics Chapter 2 and pp. 634-640 Copyright 1998-2011 Delroy A. Brinkerhoff. All Rights Reserved. CS 1410 Chapter 2 Slide 1 of 25 Program Components Function main P Every C/C++ program has

More information

Chapter 2: Introduction to C++

Chapter 2: Introduction to C++ Chapter 2: Introduction to C++ Copyright 2010 Pearson Education, Inc. Copyright Publishing as 2010 Pearson Pearson Addison-Wesley Education, Inc. Publishing as Pearson Addison-Wesley 2.1 Parts of a C++

More information

Chapter 2: Special Characters. Parts of a C++ Program. Introduction to C++ Displays output on the computer screen

Chapter 2: Special Characters. Parts of a C++ Program. Introduction to C++ Displays output on the computer screen Chapter 2: Introduction to C++ 2.1 Parts of a C++ Program Copyright 2009 Pearson Education, Inc. Copyright 2009 Publishing Pearson as Pearson Education, Addison-Wesley Inc. Publishing as Pearson Addison-Wesley

More information

Contents. Jairo Pava COMS W4115 June 28, 2013 LEARN: Language Reference Manual

Contents. Jairo Pava COMS W4115 June 28, 2013 LEARN: Language Reference Manual Jairo Pava COMS W4115 June 28, 2013 LEARN: Language Reference Manual Contents 1 Introduction...2 2 Lexical Conventions...2 3 Types...3 4 Syntax...3 5 Expressions...4 6 Declarations...8 7 Statements...9

More information

IPCoreL. Phillip Duane Douglas, Jr. 11/3/2010

IPCoreL. Phillip Duane Douglas, Jr. 11/3/2010 IPCoreL Programming Language Reference Manual Phillip Duane Douglas, Jr. 11/3/2010 The IPCoreL Programming Language Reference Manual provides concise information about the grammar, syntax, semantics, and

More information

Goals of C "" The Goals of C (cont.) "" Goals of this Lecture"" The Design of C: A Rational Reconstruction"

Goals of C  The Goals of C (cont.)  Goals of this Lecture The Design of C: A Rational Reconstruction Goals of this Lecture The Design of C: A Rational Reconstruction Help you learn about: The decisions that were available to the designers of C The decisions that were made by the designers of C Why? Learning

More information

Fundamentals of Programming

Fundamentals of Programming Fundamentals of Programming Lecture 3 - Constants, Variables, Data Types, And Operations Lecturer : Ebrahim Jahandar Borrowed from lecturer notes by Omid Jafarinezhad Outline C Program Data types Variables

More information

Have examined process Creating program Have developed program Written in C Source code

Have examined process Creating program Have developed program Written in C Source code Preprocessing, Compiling, Assembling, and Linking Introduction In this lesson will examine Architecture of C program Introduce C preprocessor and preprocessor directives How to use preprocessor s directives

More information

Continued from previous lecture

Continued from previous lecture The Design of C: A Rational Reconstruction: Part 2 Jennifer Rexford Continued from previous lecture 2 Agenda Data Types Statements What kinds of operators should C have? Should handle typical operations

More information

Basics of Java Programming

Basics of Java Programming Basics of Java Programming Lecture 2 COP 3252 Summer 2017 May 16, 2017 Components of a Java Program statements - A statement is some action or sequence of actions, given as a command in code. A statement

More information

Model Viva Questions for Programming in C lab

Model Viva Questions for Programming in C lab Model Viva Questions for Programming in C lab Title of the Practical: Assignment to prepare general algorithms and flow chart. Q1: What is a flowchart? A1: A flowchart is a diagram that shows a continuous

More information

The PCAT Programming Language Reference Manual

The PCAT Programming Language Reference Manual The PCAT Programming Language Reference Manual Andrew Tolmach and Jingke Li Dept. of Computer Science Portland State University September 27, 1995 (revised October 15, 2002) 1 Introduction The PCAT language

More information

Room 3P16 Telephone: extension ~irjohnson/uqc146s1.html

Room 3P16 Telephone: extension ~irjohnson/uqc146s1.html UQC146S1 Introductory Image Processing in C Ian Johnson Room 3P16 Telephone: extension 3167 Email: Ian.Johnson@uwe.ac.uk http://www.csm.uwe.ac.uk/ ~irjohnson/uqc146s1.html Ian Johnson 1 UQC146S1 What is

More information

YOLOP Language Reference Manual

YOLOP Language Reference Manual YOLOP Language Reference Manual Sasha McIntosh, Jonathan Liu & Lisa Li sam2270, jl3516 and ll2768 1. Introduction YOLOP (Your Octothorpean Language for Optical Processing) is an image manipulation language

More information

CS6202 - PROGRAMMING & DATA STRUCTURES UNIT I Part - A 1. W hat are Keywords? Keywords are certain reserved words that have standard and pre-defined meaning in C. These keywords can be used only for their

More information

C++ Programming: From Problem Analysis to Program Design, Third Edition

C++ Programming: From Problem Analysis to Program Design, Third Edition C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 2: Basic Elements of C++ Objectives (continued) Become familiar with the use of increment and decrement operators Examine

More information

CSCI 171 Chapter Outlines

CSCI 171 Chapter Outlines Contents CSCI 171 Chapter 1 Overview... 2 CSCI 171 Chapter 2 Programming Components... 3 CSCI 171 Chapter 3 (Sections 1 4) Selection Structures... 5 CSCI 171 Chapter 3 (Sections 5 & 6) Iteration Structures

More information

CSc 10200! Introduction to Computing. Lecture 2-3 Edgardo Molina Fall 2013 City College of New York

CSc 10200! Introduction to Computing. Lecture 2-3 Edgardo Molina Fall 2013 City College of New York CSc 10200! Introduction to Computing Lecture 2-3 Edgardo Molina Fall 2013 City College of New York 1 C++ for Engineers and Scientists Third Edition Chapter 2 Problem Solving Using C++ 2 Objectives In this

More information

Ordinary Differential Equation Solver Language (ODESL) Reference Manual

Ordinary Differential Equation Solver Language (ODESL) Reference Manual Ordinary Differential Equation Solver Language (ODESL) Reference Manual Rui Chen 11/03/2010 1. Introduction ODESL is a computer language specifically designed to solve ordinary differential equations (ODE

More information

Overview of C. Basic Data Types Constants Variables Identifiers Keywords Basic I/O

Overview of C. Basic Data Types Constants Variables Identifiers Keywords Basic I/O Overview of C Basic Data Types Constants Variables Identifiers Keywords Basic I/O NOTE: There are six classes of tokens: identifiers, keywords, constants, string literals, operators, and other separators.

More information

9/5/2018. Overview. The C Programming Language. Transitioning to C from Python. Why C? Hello, world! Programming in C

9/5/2018. Overview. The C Programming Language. Transitioning to C from Python. Why C? Hello, world! Programming in C Overview The C Programming Language (with material from Dr. Bin Ren, William & Mary Computer Science) Motivation Hello, world! Basic Data Types Variables Arithmetic Operators Relational Operators Assignments

More information

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression Chapter 1 Summary Comments are indicated by a hash sign # (also known as the pound or number sign). Text to the right of the hash sign is ignored. (But, hash loses its special meaning if it is part of

More information

Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal

Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal Expressions and Data Types CSC 121 Spring 2015 Howard Rosenthal Lesson Goals Understand the basic constructs of a Java Program Understand how to use basic identifiers Understand simple Java data types

More information

Fundamental Data Types. CSE 130: Introduction to Programming in C Stony Brook University

Fundamental Data Types. CSE 130: Introduction to Programming in C Stony Brook University Fundamental Data Types CSE 130: Introduction to Programming in C Stony Brook University Program Organization in C The C System C consists of several parts: The C language The preprocessor The compiler

More information

Basic C Programming (2) Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

Basic C Programming (2) Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island Basic C Programming (2) Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island Data Types Basic Types Enumerated types The type void Derived types

More information

COMP322 - Introduction to C++ Lecture 02 - Basics of C++

COMP322 - Introduction to C++ Lecture 02 - Basics of C++ COMP322 - Introduction to C++ Lecture 02 - Basics of C++ School of Computer Science 16 January 2012 C++ basics - Arithmetic operators Where possible, C++ will automatically convert among the basic types.

More information

The Design of C: A Rational Reconstruction (cont.)

The Design of C: A Rational Reconstruction (cont.) The Design of C: A Rational Reconstruction (cont.) 1 Goals of this Lecture Recall from last lecture Help you learn about: The decisions that were available to the designers of C The decisions that were

More information

The C Programming Language. (with material from Dr. Bin Ren, William & Mary Computer Science)

The C Programming Language. (with material from Dr. Bin Ren, William & Mary Computer Science) The C Programming Language (with material from Dr. Bin Ren, William & Mary Computer Science) 1 Overview Motivation Hello, world! Basic Data Types Variables Arithmetic Operators Relational Operators Assignments

More information

Computers Programming Course 5. Iulian Năstac

Computers Programming Course 5. Iulian Năstac Computers Programming Course 5 Iulian Năstac Recap from previous course Classification of the programming languages High level (Ada, Pascal, Fortran, etc.) programming languages with strong abstraction

More information

C Programming Language (Chapter 2 of K&R) Variables and Constants

C Programming Language (Chapter 2 of K&R) Variables and Constants C Programming Language (Chapter 2 of K&R) Types, Operators and Expressions Variables and Constants Basic objects manipulated by programs Declare before use: type var1, var2, int x, y, _X, x11, buffer;

More information

C: How to Program. Week /Mar/05

C: How to Program. Week /Mar/05 1 C: How to Program Week 2 2007/Mar/05 Chapter 2 - Introduction to C Programming 2 Outline 2.1 Introduction 2.2 A Simple C Program: Printing a Line of Text 2.3 Another Simple C Program: Adding Two Integers

More information

Flow Control. CSC215 Lecture

Flow Control. CSC215 Lecture Flow Control CSC215 Lecture Outline Blocks and compound statements Conditional statements if - statement if-else - statement switch - statement? : opertator Nested conditional statements Repetitive statements

More information

Objectives. In this chapter, you will:

Objectives. In this chapter, you will: Objectives In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types Discover how a program evaluates arithmetic expressions Learn about

More information

COMPUTER SCIENCE HIGHER SECONDARY FIRST YEAR. VOLUME II - CHAPTER 10 PROBLEM SOLVING TECHNIQUES AND C PROGRAMMING 1,2,3 & 5 MARKS

COMPUTER SCIENCE HIGHER SECONDARY FIRST YEAR.  VOLUME II - CHAPTER 10 PROBLEM SOLVING TECHNIQUES AND C PROGRAMMING 1,2,3 & 5 MARKS COMPUTER SCIENCE HIGHER SECONDARY FIRST YEAR VOLUME II - CHAPTER 10 PROBLEM SOLVING TECHNIQUES AND C PROGRAMMING 1,2,3 & 5 MARKS S.LAWRENCE CHRISTOPHER, M.C.A., B.Ed., LECTURER IN COMPUTER SCIENCE PONDICHERRY

More information

BASIC ELEMENTS OF A COMPUTER PROGRAM

BASIC ELEMENTS OF A COMPUTER PROGRAM BASIC ELEMENTS OF A COMPUTER PROGRAM CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING LOGO Contents 1 Identifier 2 3 Rules for naming and declaring data variables Basic data types 4 Arithmetic operators

More information

Language Fundamentals Summary

Language Fundamentals Summary Language Fundamentals Summary Claudia Niederée, Joachim W. Schmidt, Michael Skusa Software Systems Institute Object-oriented Analysis and Design 1999/2000 c.niederee@tu-harburg.de http://www.sts.tu-harburg.de

More information

About Codefrux While the current trends around the world are based on the internet, mobile and its applications, we try to make the most out of it. As for us, we are a well established IT professionals

More information

2.1. Chapter 2: Parts of a C++ Program. Parts of a C++ Program. Introduction to C++ Parts of a C++ Program

2.1. Chapter 2: Parts of a C++ Program. Parts of a C++ Program. Introduction to C++ Parts of a C++ Program Chapter 2: Introduction to C++ 2.1 Parts of a C++ Program Copyright 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 2-1 Parts of a C++ Program Parts of a C++ Program // sample C++ program

More information

Fundamental of C programming. - Ompal Singh

Fundamental of C programming. - Ompal Singh Fundamental of C programming - Ompal Singh HISTORY OF C LANGUAGE IN 1960 ALGOL BY INTERNATIONAL COMMITTEE. IT WAS TOO GENERAL AND ABSTRUCT. IN 1963 CPL(COMBINED PROGRAMMING LANGUAGE) WAS DEVELOPED AT CAMBRIDGE

More information

Spoke. Language Reference Manual* CS4118 PROGRAMMING LANGUAGES AND TRANSLATORS. William Yang Wang, Chia-che Tsai, Zhou Yu, Xin Chen 2010/11/03

Spoke. Language Reference Manual* CS4118 PROGRAMMING LANGUAGES AND TRANSLATORS. William Yang Wang, Chia-che Tsai, Zhou Yu, Xin Chen 2010/11/03 CS4118 PROGRAMMING LANGUAGES AND TRANSLATORS Spoke Language Reference Manual* William Yang Wang, Chia-che Tsai, Zhou Yu, Xin Chen 2010/11/03 (yw2347, ct2459, zy2147, xc2180)@columbia.edu Columbia University,

More information

There are four numeric types: 1. Integers, represented as a 32 bit (or longer) quantity. Digits sequences (possibly) signed are integer literals:

There are four numeric types: 1. Integers, represented as a 32 bit (or longer) quantity. Digits sequences (possibly) signed are integer literals: Numeric Types There are four numeric types: 1. Integers, represented as a 32 bit (or longer) quantity. Digits sequences (possibly) signed are integer literals: 1-123 +456 2. Long integers, of unlimited

More information

Princeton University Computer Science 217: Introduction to Programming Systems The Design of C

Princeton University Computer Science 217: Introduction to Programming Systems The Design of C Princeton University Computer Science 217: Introduction to Programming Systems The Design of C C is quirky, flawed, and an enormous success. While accidents of history surely helped, it evidently satisfied

More information

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University Unit 1 Programming Language and Overview of C 1. State whether the following statements are true or false. a. Every line in a C program should end with a semicolon. b. In C language lowercase letters are

More information

The Design of C: A Rational Reconstruction: Part 2

The Design of C: A Rational Reconstruction: Part 2 The Design of C: A Rational Reconstruction: Part 2 1 Continued from previous lecture 2 Agenda Data Types Operators Statements I/O Facilities 3 Operators Issue: What kinds of operators should C have? Thought

More information

JME Language Reference Manual

JME Language Reference Manual JME Language Reference Manual 1 Introduction JME (pronounced jay+me) is a lightweight language that allows programmers to easily perform statistic computations on tabular data as part of data analysis.

More information

CS313D: ADVANCED PROGRAMMING LANGUAGE

CS313D: ADVANCED PROGRAMMING LANGUAGE CS313D: ADVANCED PROGRAMMING LANGUAGE Computer Science department Lecture 2 : C# Language Basics Lecture Contents 2 The C# language First program Variables and constants Input/output Expressions and casting

More information

Mirage. Language Reference Manual. Image drawn using Mirage 1.1. Columbia University COMS W4115 Programming Languages and Translators Fall 2006

Mirage. Language Reference Manual. Image drawn using Mirage 1.1. Columbia University COMS W4115 Programming Languages and Translators Fall 2006 Mirage Language Reference Manual Image drawn using Mirage 1.1 Columbia University COMS W4115 Programming Languages and Translators Fall 2006 Prof. Stephen Edwards Team Members: Abhilash I ai2160@columbia.edu

More information

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Weiss Chapter 1 terminology (parenthesized numbers are page numbers) Weiss Chapter 1 terminology (parenthesized numbers are page numbers) assignment operators In Java, used to alter the value of a variable. These operators include =, +=, -=, *=, and /=. (9) autoincrement

More information

Visual C# Instructor s Manual Table of Contents

Visual C# Instructor s Manual Table of Contents Visual C# 2005 2-1 Chapter 2 Using Data At a Glance Instructor s Manual Table of Contents Overview Objectives s Quick Quizzes Class Discussion Topics Additional Projects Additional Resources Key Terms

More information

Expressions and Precedence. Last updated 12/10/18

Expressions and Precedence. Last updated 12/10/18 Expressions and Precedence Last updated 12/10/18 Expression: Sequence of Operators and Operands that reduce to a single value Simple and Complex Expressions Subject to Precedence and Associativity Six

More information

6.096 Introduction to C++ January (IAP) 2009

6.096 Introduction to C++ January (IAP) 2009 MIT OpenCourseWare http://ocw.mit.edu 6.096 Introduction to C++ January (IAP) 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. Welcome to 6.096 Lecture

More information

Course Outline Introduction to C-Programming

Course Outline Introduction to C-Programming ECE3411 Fall 2015 Lecture 1a. Course Outline Introduction to C-Programming Marten van Dijk, Syed Kamran Haider Department of Electrical & Computer Engineering University of Connecticut Email: {vandijk,

More information

Chapter 2 - Introduction to C Programming

Chapter 2 - Introduction to C Programming Chapter 2 - Introduction to C Programming 2 Outline 2.1 Introduction 2.2 A Simple C Program: Printing a Line of Text 2.3 Another Simple C Program: Adding Two Integers 2.4 Memory Concepts 2.5 Arithmetic

More information

Introduction to C Language

Introduction to C Language Introduction to C Language Instructor: Professor I. Charles Ume ME 6405 Introduction to Mechatronics Fall 2006 Instructor: Professor Charles Ume Introduction to C Language History of C Language In 1972,

More information

The C++ Language. Arizona State University 1

The C++ Language. Arizona State University 1 The C++ Language CSE100 Principles of Programming with C++ (based off Chapter 2 slides by Pearson) Ryan Dougherty Arizona State University http://www.public.asu.edu/~redoughe/ Arizona State University

More information

egrapher Language Reference Manual

egrapher Language Reference Manual egrapher Language Reference Manual Long Long: ll3078@columbia.edu Xinli Jia: xj2191@columbia.edu Jiefu Ying: jy2799@columbia.edu Linnan Wang: lw2645@columbia.edu Darren Chen: dsc2155@columbia.edu 1. Introduction

More information