Lecture #2 Perl Syntaxes Introduction a Perl Script Consists of a Sequence

Total Page:16

File Type:pdf, Size:1020Kb

Lecture #2 Perl Syntaxes Introduction a Perl Script Consists of a Sequence Lecture #2 Perl Syntaxes Introduction A Perl script consists of a sequence of declarations and statements which run from the top to the bottom; therefore, the scripting requires basic understanding of syntaxes. Literally, a declaration specifies the name and data type of a variable or script element; statements are the instructions programmers write to tell Perl interpreter what to do. The following is a declaration of variable x as scalar type of data. In programming, any data types that hold a single data item called scalar (or base) data types. Programming languages like C++ or Java has scalar type like char, int, short long, float, and double. Interestingly, Perl does not have a variety of scalar data types. Perl only distinguish string and numbers. $x = 7; # variable The following is a sample statement. Perl statements end in a semi-colon (;): print "Hello, world!"; Statements frequently contain expressions. An expression is something which evaluates to a value. The following is a statement with an expression because (3<5) will be evaluated to true. The ouput is 1 which means true. print (3<5); Expressions are often part of a loop (repetition structure) or a decisive statement (such as the if statement or the conditional operator) because they typically return a Boolean result: true or false. The following uses the conditional operator (? :) to evaluate an expression ($s > 60). #!"X:\xampp\perl\bin\perl.exe" print "Enter your score: "; $s = <>; $grade = ($s > 60)? "passed" : "Not passed"; print "$grade\n"; A Perl script is made of a combination of statements. Some statements are declaration; others are expressions. Many statements contains both declaration and expressions. The following is an example of complicated Perl statements. #!"X:\xampp\perl\bin\perl.exe" X must be the correct drive name print "Content-Type: text/html\n\n"; print "<html><head>", # comma as separator "<title>Test Page</title></head>", #comma as separator "<body>"; # semicolon [end of line] $x = 7; # declare a scalr variable $y = 5; # variable if ($y <= $x) # test expression { $msg = "CIS245!"; # variable } print "$msg</body></html>"; 38 All the lines of code you have just seen are examples of Perl statements. Basically, a statement is one task for the Perl interpreter to perform. A statement can contain construct, variables, expression, or any combination of them. The semicolon (;) indicates the end of each statement, while comma (,) is a separator between sections of a statement. The print construct, as discussed in the previous lecture, supports the comma (,) sign to break a long statement into lines. #!"X:\xampp\perl\bin\perl.exe" print "Content-type: text/html\n\n", "<!Doctype html>", "<html><body>", "<h1>Hello, World!</h1>", "</body></html>"; A Perl program can be thought of as a collection of statements performed one at a time. When the Perl interpreter sees a statement, it breaks the statement down into smaller units of information. In this example, the smaller units of information are $x, =, 7, and ;. Each of these smaller units of information is called a token. Perl statements can be grouped into blocks. A Perl block is enclosed by a pair of curly brackets. In the above code, the if statement is an example of blocks. The following is another example that uses the “sub” keyword to create a subroutine which has its own code block. A later lecture will discuss to how create subroutine in details. #!"X:\xampp\perl\bin\perl.exe" print "Content-Type: text/html\n\n"; print "<!Doctype html>"; print "<html><body>"; sub Hello { print "Hello, World!"; } Hello(); #call the subroutine print "</body></html>"; Perl is a case sensitive language. File names, variables, and arrays are all case sensitive. If you capitalize a variable name when you define it, you must capitalize it to call it. $X and $x are two different variables. Perl Data Perl has three built-in data types: scalars, arrays, and hashes. A scalar is either a single string Types and or a number in most of the cases. Yet, it can also be a reference to something. A sting literal is Variables a combination of characters enclosed by either single quotes or double-quotes. These quotes are not a part of the string they just mark the beginning and end of the string for the Perl interpreter. The following are some examples. '239' "45.5" 'four' "Jennifer Lopez" "Penn State University" Both ‘239’ and “45.5” are not numbers. ‘239’ is not a unit of anything. It is a combination of character: 2, 3, and 9. “45.5” does not mean a value of forty-five and a half. It is a combination 39 of characters: 4, 5, ., and 5. The blank space between Jennifer and Lopez in the string “Jennifer Lopez” as well as those in “Penn State University” is also a character called “blank” character. There are actually two varieties of null strings (sometimes referred to as “empty” strings), a defined one and an undefined one. The defined version is just a string of length zero, such as "" . #!"X:\xampp\perl\bin\perl.exe" $x = ""; print $x; The undefined version is the use of keyword “undef” which indicates “no real value” for the variable. #!"X:\xampp\perl\bin\perl.exe" $x = undef; print $x; It is necessary to understand the difference between a null character and a blank character. A null character does not take any bits, while a blank character does. A blank character can be considered as an invisible character. The following is a sample code that use the length() method to return the length of characters in a string. The comma sign (,) is the separator of the print function, and “\n” inserts a newline. #!"X:\xampp\perl\bin\perl.exe" print length(""), "\n<br>"; print length(" "), "\n<br>"; print length(''), "\n<br>"; print length(' '), "\n<br>"; To test the above code, name the script as “test.pl” and save it under the “X:\xampp\perl\bin\” directory, where “X” is the drive name that host XAMPP. Open the Microsoft Command Prompt, change to the “X:\xampp\perl\bin\” directory, and then issue perl test.pl. X:\cd xampp\perl\bin X:\xampp\perl\bin>pel test.pl 0 1 0 1 Numeric literals (numbers) could be floating point or integer formats, as shown in the following table. Format Example integer 627 floating point 345.29 Scientific .23E-10 hex 0xff octal 0377 binary 0b011011 The following is a Web-ready script that illustrates how these variations works. Interestingly, most Web browser ignores blank space created by “\n”. To break a line in a browser, you need to use the <br> HTML tag. #!"X:\xampp\perl\bin\perl.exe" print "Content-Type: text/html\n\n"; 40 print "<!Doctype html>"; print "<html><body>"; print 627, "\n<br>"; print 345.29, "\n<br>"; print .23E-10, "\n<br>"; print 0xff, "\n<br>"; print 0377, "\n<br>"; print 0b011011, "\n<br>"; print "</body></html>"; It is necessary to distinguish string and numbers. Strings may contain any symbol, letter, or number. Must be enclosed by quotes. E.g. “23”, “3.1412”, and “hell”. Numbers may contain exponents, integers, or decimal values. E.g.: 23, 3.1412. A Perl variable is a temporary name given by the programmers to mark an area of the physical memory to temporarily store a value. Throughout the duration of the Perl script. In Perl, variables are declared to hold a scalar which could be a single value, such as a string, a number, or a reference. A Perl variable names begin with a dollar sign ($). They can be any combination of letters, numbers, or underscores. Names that start with a digit may only contain more digits. Names that do not start with a letter, digit, or underscore are limited to one character besides the $ ($*, etc.). $x $age $firstName $Student_ID $bloodType Perl variables do not have to be explicitly declared to reserve memory space, which means you do not need to specify the data type like int, float, double, string, char, and so on. The following compare Perl variable declaration with that in C++. Perl C++ $x double x $age float age $firstName string firstName $Student_ID string Student_ID $bloodType char bloodType The above scalar variables (age, firstName, and Student_ID) do not have initial values (also known as default values), meaning they do not represent any value at the time they are declared. Perl uses assignment statements to give a variable some value, or to change the existing value of a variable. The following is the syntax for assigning a value to a variable, where variableName is the variable’s name, and value is the number or string you want to store in (or be represented by) the variable name. variableName = value; The following is a script that demonstrates how to declare variables and assign their initial values. Again, when declaring a string variable with initial value, the value must be enclosed by a pair of quotes. #!"X:\xampp\perl\bin\perl.exe" print "Content-Type: text/html\n\n"; print "<!Doctype html>"; 41 print "<html><body>"; $x = 3.12; $age = 41; $firstName = "Jennifer"; $Student_ID = "D004821256"; $bloodType = 'A'; $score = ""; print "</body></html>"; The syntax to retrieve the value of a variable is: $variableName The following is an Web-ready script that illustrates how to declare a variable, assign an initial value, and retrieve the value of a Perl variable. #!"X:\xampp\perl\bin\perl.exe" print "Content-Type: text/html\n\n"; print "<!Doctype html>"; print "<html><body>"; $x = 3.12; $age = 41; $firstName = "Jennifer"; $Student_ID = "D004821256"; $bloodType = 'A'; $score = ""; print $x, "\n<br>"; print $age, "\n<br>"; print $firstName, "\n<br>"; print $Student_ID, "\n<br>"; print $bloodType, "\n<br>"; print "</body></html>"; Remember, a scalar variable can only hold one value at a given time.
Recommended publications
  • Using ANSI Color Codes General Configuration of the Shell
    LinuxFocus article number 335 http://linuxfocus.org Colorful Shells -- Using ANSI Color Codes by Nico Golde <nico/at/ngolde.de> About the author: At present Nico is still a Abstract: student. Since a few years he keeps very busy with In an ANSI compatible terminal (like xterm, rxvt, konsole ...) text may Linux, he also takes part in be shown in colors different from black/white. This article will a number of Open Source demonstrate text in bold or in color. Projects. _________________ _________________ _________________ Translated to English by: Jürgen Pohl <sept.sapins(at)verizon.net> General In real life every Linux user gets to face the Bash. At first glance that looks very boring, but there are many possibilities to give one’s shell the personal touch. Colored enhancement of the shell prompt make the shell unique as well as better legible. In my description I will refer to the Bash shell. The escape sequences may differ between terminals, for this text I am using an ANSI terminal. Configuration of the Shell Setting of shell colors happens in the personal configuration file of the bash ~/.bashrc or in the global configuration file /etc/bashrc. The appearance of the prompt is being set with the PS1 variable in bashrc. Generally, the entry should look like this: ~/.bashrc: PS1="\s-\v\$ " \s stands for the name of the shell and -\v for its version. At the end of the prompt we are placing a $. Since this gets a bit boring, the following entry - which is default in most Linux distributions - may be used: ~/.bashrc: PS1="\u@\h \w \$ " This stands for user@ current_directory $, which is the normal shell prompt most Linux users are familiar with.
    [Show full text]
  • CS 106 Introduction to Computer Science I
    CS 106 Introduction to Computer Science I 07 / 06 / 2021 Instructor: Michael Eckmann Today’s Topics • Introduction • Review the syllabus – including the policies on academic dishonesty and improper collaboration • Introductory comments on programming languages • An example of a simple Python program • Printing Michael Eckmann - Skidmore College - CS 106 - Summer 2021 Who is your instructor? • I'm Mike Eckmann, an Associate Professor in the Computer Science Dept., Skidmore College. I have been at Skidmore since 2004. Before coming to Skidmore I was at Lehigh University in PA. • I studied Mathematics and Computer Engineering and Computer Science all at Lehigh University. • I was employed as a programmer (systems analyst) for eight years. Michael Eckmann - Skidmore College - CS 106 - Summer 2021 1st Homework • Read the syllabus and review the improper collaboration policy (both will be available on our course webpage.) • Read chapter 1 of text. • Will send course webpage and a questionnaire via email later this class. Michael Eckmann - Skidmore College - CS 106 - Summer 2021 Syllabus • Office hours • Collaboration policy – By appointment • Grading scheme • Text book • Workload • Assignments • Student preparation – Programs & HW before class Note: The most up-to-date syllabus will be found on the course web page. Michael Eckmann - Skidmore College - CS 106 - Summer 2021 This semester we will ... • Be introduced to computer science. • Learn programming (in Python)! • Solve problems and learn to think like programmers. • Hopefully have a fun learning experience. Michael Eckmann - Skidmore College - CS 106 - Summer 2021 Computer Science is ... • more than computer programming. Michael Eckmann - Skidmore College - CS 106 - Summer 2021 Programming Languages • Machine • Assembly • High-level – in no particular order – Pascal, C, C++, Basic, Fortran, Java, Python and many, many more ..
    [Show full text]
  • AVR244 AVR UART As ANSI Terminal Interface
    AVR244: AVR UART as ANSI Terminal Interface Features 8-bit • Make use of standard terminal software as user interface to your application. • Enables use of a PC keyboard as input and ascii graphic to display status and control Microcontroller information. • Drivers for ANSI/VT100 Terminal Control included. • Interactive menu interface included. Application Note Introduction This application note describes some basic routines to interface the AVR to a terminal window using the UART (hardware or software). The routines use a subset of the ANSI Color Standard to position the cursor and choose text modes and colors. Rou- tines for simple menu handling are also implemented. The routines can be used to implement a human interface through an ordinary termi- nal window, using interactive menus and selections. This is particularly useful for debugging and diagnostics purposes. The routines can be used as a basic interface for implementing more complex terminal user interfaces. To better understand the code, an introduction to ‘escape sequences’ is given below. Escape Sequences The special terminal functions mentioned (e.g. text modes and colors) are selected using ANSI escape sequences. The AVR sends these sequences to the connected terminal, which in turn executes the associated commands. The escape sequences are strings of bytes starting with an escape character (ASCII code 27) followed by a left bracket ('['). The rest of the string decides the specific operation. For instance, the command '1m' selects bold text, and the full escape sequence thus becomes 'ESC[1m'. There must be no spaces between the characters, and the com- mands are case sensitive. The various operations used in this application note are described below.
    [Show full text]
  • Introduction to C++
    GVNS I PUC Computer Science Notes Chapter 7 – INTRODUCTION TO C++ UNIT C – Chapter 7 – INTRODUCTION TO C++ BLUEPRINT 1 MARK 2 MARK 3 MARK 5 MARK TOTAL 1 0 1 1 9 ONE Mark Questions and Answers 1. Who developed “ C++ “ programming language and where? Bjarne Stroustrup designed C++ programming language at AT & T Bell Labs. 2. C++ is a subset of C. True or false? True 3. How can comments be included in a program? Comments can be included in C++ program by writing the comment between the symbols /* and */ or by starting the comment with double front slash ( // ). 4. Define token. A token is the smallest individual unit in a program. 5. Mention two tokens. Two tokens are keyword, identifier. (Note: refer to your textbook for more tokens) 6. What are keywords? Keywords are predefined word with some meanings. 7. Mention any four keywords in C++. The four keywords are int, if, do, for. (Note: refer to your textbook for more keywords) 8. What is a constant? Constants are quantities whose value cannot be changed during the execution of a program. 9. What are escape sequences? Escape sequences are characters that as special meaning and it starts with back slash ( \ ). 10. Mention any two escape sequences. Two escape sequences are \n and \t (Note: refer to your textbook for more escape sequences) 11. What is a string? String is a sequence of characters enclosed in double quotes. 12. What are punctuators? Punctuators are symbols used in a C++ program as seperators. 13. What is an operand? The data items on which operators act are called operands.
    [Show full text]
  • VSI Openvms C Language Reference Manual
    VSI OpenVMS C Language Reference Manual Document Number: DO-VIBHAA-008 Publication Date: May 2020 This document is the language reference manual for the VSI C language. Revision Update Information: This is a new manual. Operating System and Version: VSI OpenVMS I64 Version 8.4-1H1 VSI OpenVMS Alpha Version 8.4-2L1 Software Version: VSI C Version 7.4-1 for OpenVMS VMS Software, Inc., (VSI) Bolton, Massachusetts, USA C Language Reference Manual Copyright © 2020 VMS Software, Inc. (VSI), Bolton, Massachusetts, USA Legal Notice Confidential computer software. Valid license from VSI required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license. The information contained herein is subject to change without notice. The only warranties for VSI products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. VSI shall not be liable for technical or editorial errors or omissions contained herein. HPE, HPE Integrity, HPE Alpha, and HPE Proliant are trademarks or registered trademarks of Hewlett Packard Enterprise. Intel, Itanium and IA64 are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. Java, the coffee cup logo, and all Java based marks are trademarks or registered trademarks of Oracle Corporation in the United States or other countries. Kerberos is a trademark of the Massachusetts Institute of Technology.
    [Show full text]
  • ANSI® Programmer's Reference Manual Line Matrix Series Printers
    ANSI® Programmer’s Reference Manual Line Matrix Series Printers Printronix, LLC makes no representations or warranties of any kind regarding this material, including, but not limited to, implied warranties of merchantability and fitness for a particular purpose. Printronix, LLC shall not be held responsible for errors contained herein or any omissions from this material or for any damages, whether direct, indirect, incidental or consequential, in connection with the furnishing, distribution, performance or use of this material. The information in this manual is subject to change without notice. This document contains proprietary information protected by copyright. No part of this document may be reproduced, copied, translated or incorporated in any other material in any form or by any means, whether manual, graphic, electronic, mechanical or otherwise, without the prior written consent of Printronix, LLC Copyright © 1998, 2012 Printronix, LLC All rights reserved. Trademark Acknowledgements ANSI is a registered trademark of American National Standards Institute, Inc. Centronics is a registered trademark of Genicom Corporation. Dataproducts is a registered trademark of Dataproducts Corporation. Epson is a registered trademark of Seiko Epson Corporation. IBM and Proprinter are registered trademarks and PC-DOS is a trademark of International Business Machines Corporation. MS-DOS is a registered trademark of Microsoft Corporation. Printronix, IGP, PGL, LinePrinter Plus, and PSA are registered trademarks of Printronix, LLC. QMS is a registered
    [Show full text]
  • Delimited Escape Sequences
    Delimited escape sequences Document #: N2785 Date: 2021-07-28 Project: Programming Language C Audience: Application programmers Proposal category: New feature Reply-to: Corentin Jabot <[email protected]> Aaron Ballman <[email protected]> Abstract We propose an additional, clearly delimited syntax for octal, hexadecimal and universal character name escape sequences to clearly delimit the boundaries of the escape sequence. WG21 has shown an interest in adjusting this feature, and this proposal is intended to keep C and C++ in alignment. This feature is a pure extension to the language that should not impact existing code. Motivation universal-character-name escape sequences As their name does not indicate, universal-character-name escape sequences represent Uni- code scalar values, using either 4, or 8 hexadecimal digits, which is either 16 or 32 bits. However, the Unicode codespace is limited to 0-0x10FFFF, and all currently assigned code- points can be written with 5 or less hexadecimal digits (Supplementary Private Use Area-B non-withstanding). As such, the ~50% of codepoints that need 5 hexadecimal digits to be expressed are currently a bit awkward to write: \U0001F1F8. Octal and hexadecimal escape sequences have variable length \1, \01, \001 are all valid escape sequences. \17 is equivalent to "0x0F" while \18 is equivalent to "0x01" "8" While octal escape sequences accept 1 to 3 digits as arguments, hexadecimal sequences accept an arbitrary number of digits applying the maximal much principle. This is how the Microsoft documentation describes this problem: 1 Unlike octal escape constants, the number of hexadecimal digits in an escape sequence is unlimited.
    [Show full text]
  • DICOM Correction Item
    DICOM Correction Item Correction Number: CP-155 Submission Abstract: Add support for ISO-IR 149 Korean character sets Type of Change Proposal: Name of Document: Addition PS 3.3-1999: Information Object Definitions, PS 3.5-1999: Data Structures and Encoding Rationale for change: Korea uses its own characters, Hangul, and Hangul needs to be used in DICOM. Hangul can be implemented easily in DICOM by character encoding methods that PS 3.5 has defined. A Defined Term for Character set for Hangul needs to be added in Table C.12-4 of PS 3.3 Sections of document affected/ Suggest Wording of Change: Part 3 1. C.12.1.1.2 Specific Character Set Add the following entry to Table C.12-4. Table C.12-4 DEFINED TERMS FOR MULTIPLE-BYTE CHARACTER SETS WITH CODE EXTENSIONS Character Set Defined Standard ESC ISO Number of Code Character Description Term for Code Sequence registration characters element Set Extension number Korean ISO 2022 ISO 2022 ESC 02/04 ISO-IR 149 942 G1 KS X 1001: IR 149 02/09 04/03 Hangul and Hanja Part 5 1. Section 2 Add the following Hangul multi-byte character set to the end of section 2 “Normative references”: KS X 1001-1997 Code for Information Interchange (Hangul and Hanja) 2. Section 6.1.2.4 Code Extension Techniques Modify the Note to read: 2. Support for Japanese kanji (ideographic), hiragana (phonetic), and katakana(phonetic) characters, and Korean characters (Hangul) is defined in PS3.3. Definition of Chinese Korean, and other multi-byte character sets awaits consideration by the appropriate standards organizations.
    [Show full text]
  • Java/Java Characters.Htm Copyright © Tutorialspoint.Com
    JJAAVVAA -- CCHHAARRAACCTTEERR CCLLAASSSS http://www.tutorialspoint.com/java/java_characters.htm Copyright © tutorialspoint.com Normally, when we work with characters, we use primitive data types char. Example: char ch = 'a'; // Unicode for uppercase Greek omega character char uniChar = '\u039A'; // an array of chars char[] charArray ={ 'a', 'b', 'c', 'd', 'e' }; However in development, we come across situations where we need to use objects instead of primitive data types. In order to achieve this, Java provides wrapper class Character for primitive data type char. The Character class offers a number of useful class i. e. , static methods for manipulating characters. You can create a Character object with the Character constructor: Character ch = new Character('a'); The Java compiler will also create a Character object for you under some circumstances. For example, if you pass a primitive char into a method that expects an object, the compiler automatically converts the char to a Character for you. This feature is called autoboxing or unboxing, if the conversion goes the other way. Example: // Here following primitive char 'a' // is boxed into the Character object ch Character ch = 'a'; // Here primitive 'x' is boxed for method test, // return is unboxed to char 'c' char c = test('x'); Escape Sequences: A character preceded by a backslash (\) is an escape sequence and has special meaning to the compiler. The newline character \n has been used frequently in this tutorial in System.out.println statements to advance to the next line after the string is printed. Following table shows the Java escape sequences: Escape Sequence Description \t Inserts a tab in the text at this point.
    [Show full text]
  • Cmsc 313 Computer Organization & Assembly
    CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 07, SPRING 2013 TOPICS TODAY • Project 2 • A Bigger Example A BIGGER EXAMPLE CMSC 313, Computer Organization & Assembly Language Programming Section 0101 Fall 2001 Project 1: Escape Sequences Due: Tuesday October 9, 2001 <--- !!!!!! OLD PROJECT !!!!! Objective The objectives of the programming assignment are 1) to gain experience writing larger assembly language programs, and 2) to gain familiarity with various branching operations. Background String constants in UNIX and in C/C++ are allowed to contain control characters and other hard- to-type characters. The most familiar of these is ‘\n’ for a newline or linefeed character (ASCII code 10). The ‘\n’ is called an escape sequence. For this project, we will consider the following escape sequences: Sequence Name ASCII code \a alert(bell) 07 \b backspace 08 \t horizontal tab 09 \n newline 10 \v vertical tab 11 \f formfeed 12 \r carriage return 13 \\ backslash 92 In addition, strings can have octal escape sequences. An octal escape sequence is a ‘\’ followed by one, two or three octal digits. For example, ‘\a’ is equivalent to ‘\7’ and ‘\\’ is equivalent to ‘\134’. Note that in this scheme, the null character can be represented as ‘\0’. The octal escape sequence ends at the third octal digit, before the end of the string, or before the first non-octal digit, whichever comes first. For example "abc\439xyz" is equivalent to "abc#9xyz" because the ASCII code for ‘#’ is 438 and 9 is not an octal digit. Assignment For this project, you will write a program in assembly language which takes a string input by the user, convert the escape sequences in the string as described above and print out the converted string.
    [Show full text]
  • Code Extension Techniques for Use with the 7-Bit Coded Character Set of American National Standard Code for Information Interchange
    ANSI X3.41-1974 American National Standard Adopted for Use by the Federal Government code extension techniques for use with the 7-bit coded character set of american national standard code FIPS 35 See Notice on Inside Front Cover for information interchange X3.41-1974 This standard was approved as a Federal Information Processing Standard by the Secretary of Commerce on March 6, 1975. Details concerning its use within the Federal Government are contained in FIPS 35, CODE EXTENSION TECHNIQUES IN 7 OR 8 BITS. For a complete list of the publications available in the FEDERAL INFORMATION PROCESSING STANDARDS Series, write to the Office of Technical Information and Publications, National Bureau of Standards, Washington, D.C. 20234. mw, si S&sdftfe DEC 7 S73 ANSI X3.41-1974 American National Standard Code Extension Techniques for Use with the 7-Bit Coded Character Set of American National Standard Code for Information Interchange Secretariat Computer and Business Equipment Manufacturers Association Approved May 14, 1974 American National Standards Institute, Inc American An American National Standard implies a consensus of those substantially concerned with its scope and provisions. An American National Standard is intended as a guide to aid the manu¬ National facturer, the consumer, and the general public. The existence of an American National Stan¬ dard does not in any respect preclude anyone, whether he has approved the standard or not, Standard from manufacturing, marketing, purchasing, or using products, processes, or procedures not conforming to the standard. American National Standards are subject to periodic review and users are cautioned to obtain the latest editions.
    [Show full text]
  • SPML Language Reference Manual
    SPML Language Reference Manual Jayesh Kataria, [email protected] Dhivya Khrishnan, [email protected] Stefano Pacifico,[email protected] Hye Seon Yi, [email protected] March 5, 2007 SPML Language Reference Manual 1. Introduction This document is a reference manual for SPML (Simple PDF Manipulation Language), a language for Simple PDF Manipulations. 2. Lexical Conventions 2.1 Tokens Tokens are divided in the following classes: Identifiers Keywords Constants String Literals Operators Other Separators Blanks, horizontal and vertical tabs, newlines, formfeeds and comments are considered as “white space”. They have no semantic meaning, and are used only as token separators. The input stream is divided into tokens where each token is a group of valid characters that could constitute a token. 2.2 Comments Comments are defined as a stream of characters that begin with the sequence /* and end with the sequence */ . Comments cannot be nested and cannot occur inside a string or character literals. 2.3 Identifiers An identifier is a sequence of letters and digits. The first letter must be a character between [A-Z] or [a-z]. The remaining characters can be from [A-Z] or [a-z] or digits from [0-9] or the underscore ( _ ) character. 2.4 Keywords The following identifiers have been reserved as keywords and cannot be used otherwise break close continue create else extractpage getauthor highlight if in int merge open pdf print return setauthor start string totextfile void while 2.5 Constants 1 SPML Language Reference Manual The different kinds of constants supported by SPML are : 2.5.1 Integer Constants SPML only supports integer constants to the base 10 i.e.
    [Show full text]