Bison the Yacc-Compatible Parser Generator 10 September 2021, Bison Version 3.8.1

Total Page:16

File Type:pdf, Size:1020Kb

Bison the Yacc-Compatible Parser Generator 10 September 2021, Bison Version 3.8.1 Bison The Yacc-compatible Parser Generator 10 September 2021, Bison Version 3.8.1 by Charles Donnelly and Richard Stallman This manual (10 September 2021) is for GNU Bison (version 3.8.1), the GNU parser gen- erator. Copyright c 1988{1993, 1995, 1998{2015, 2018{2021 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover texts being \A GNU Manual," and with the Back-Cover Texts as in (a) below. A copy of the license is included in the section entitled \GNU Free Documentation License." (a) The FSF's Back-Cover Text is: \You have the freedom to copy and modify this GNU manual. Buying copies from the FSF supports it in developing GNU and promoting software freedom." Published by the Free Software Foundation 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA Printed copies are available from the Free Software Foundation. ISBN 1-882114-44-2 Cover art by Etienne Suvasa. i Table of Contents Introduction ::::::::::::::::::::::::::::::::::::::::: 1 Conditions for Using Bison ::::::::::::::::::::::::: 2 GNU GENERAL PUBLIC LICENSE ::::::::::::: 3 1 The Concepts of Bison::::::::::::::::::::::::: 14 1.1 Languages and Context-Free Grammars:::::::::::::::::::::::: 14 1.2 From Formal Rules to Bison Input ::::::::::::::::::::::::::::: 15 1.3 Semantic Values ::::::::::::::::::::::::::::::::::::::::::::::: 16 1.4 Semantic Actions :::::::::::::::::::::::::::::::::::::::::::::: 17 1.5 Writing GLR Parsers :::::::::::::::::::::::::::::::::::::::::: 17 1.5.1 Using GLR on Unambiguous Grammars::::::::::::::::::: 18 1.5.2 Using GLR to Resolve Ambiguities:::::::::::::::::::::::: 20 1.5.3 GLR Semantic Actions ::::::::::::::::::::::::::::::::::: 23 1.5.3.1 Deferred semantic actions :::::::::::::::::::::::::::: 23 1.5.3.2 YYERROR :::::::::::::::::::::::::::::::::::::::::: 23 1.5.3.3 Restrictions on semantic values and locations::::::::: 24 1.5.4 Controlling a Parse with Arbitrary Predicates ::::::::::::: 24 1.6 Locations ::::::::::::::::::::::::::::::::::::::::::::::::::::: 24 1.7 Bison Output: the Parser Implementation File ::::::::::::::::: 25 1.8 Stages in Using Bison:::::::::::::::::::::::::::::::::::::::::: 26 1.9 The Overall Layout of a Bison Grammar::::::::::::::::::::::: 26 2 Examples ::::::::::::::::::::::::::::::::::::::: 28 2.1 Reverse Polish Notation Calculator :::::::::::::::::::::::::::: 28 2.1.1 Declarations for rpcalc::::::::::::::::::::::::::::::::::: 28 2.1.2 Grammar Rules for rpcalc ::::::::::::::::::::::::::::::: 29 2.1.2.1 Explanation of input :::::::::::::::::::::::::::::::: 30 2.1.2.2 Explanation of line ::::::::::::::::::::::::::::::::: 30 2.1.2.3 Explanation of exp :::::::::::::::::::::::::::::::::: 31 2.1.3 The rpcalc Lexical Analyzer ::::::::::::::::::::::::::::: 31 2.1.4 The Controlling Function ::::::::::::::::::::::::::::::::: 33 2.1.5 The Error Reporting Routine ::::::::::::::::::::::::::::: 33 2.1.6 Running Bison to Make the Parser :::::::::::::::::::::::: 33 2.1.7 Compiling the Parser Implementation File :::::::::::::::: 34 2.2 Infix Notation Calculator: calc:::::::::::::::::::::::::::::::: 34 2.3 Simple Error Recovery::::::::::::::::::::::::::::::::::::::::: 36 2.4 Location Tracking Calculator: ltcalc ::::::::::::::::::::::::: 37 2.4.1 Declarations for ltcalc::::::::::::::::::::::::::::::::::: 37 2.4.2 Grammar Rules for ltcalc ::::::::::::::::::::::::::::::: 37 ii 2.4.3 The ltcalc Lexical Analyzer.::::::::::::::::::::::::::::: 38 2.5 Multi-Function Calculator: mfcalc :::::::::::::::::::::::::::: 40 2.5.1 Declarations for mfcalc::::::::::::::::::::::::::::::::::: 40 2.5.2 Grammar Rules for mfcalc ::::::::::::::::::::::::::::::: 41 2.5.3 The mfcalc Symbol Table :::::::::::::::::::::::::::::::: 42 2.5.4 The mfcalc Lexer :::::::::::::::::::::::::::::::::::::::: 44 2.5.5 The mfcalc Main::::::::::::::::::::::::::::::::::::::::: 46 2.6 Exercises :::::::::::::::::::::::::::::::::::::::::::::::::::::: 46 3 Bison Grammar Files :::::::::::::::::::::::::: 47 3.1 Outline of a Bison Grammar::::::::::::::::::::::::::::::::::: 47 3.1.1 The prologue ::::::::::::::::::::::::::::::::::::::::::::: 47 3.1.2 Prologue Alternatives ::::::::::::::::::::::::::::::::::::: 48 3.1.3 The Bison Declarations Section ::::::::::::::::::::::::::: 52 3.1.4 The Grammar Rules Section :::::::::::::::::::::::::::::: 52 3.1.5 The epilogue ::::::::::::::::::::::::::::::::::::::::::::: 53 3.2 Symbols, Terminal and Nonterminal ::::::::::::::::::::::::::: 53 3.3 Grammar Rules ::::::::::::::::::::::::::::::::::::::::::::::: 55 3.3.1 Syntax of Grammar Rules :::::::::::::::::::::::::::::::: 55 3.3.2 Empty Rules ::::::::::::::::::::::::::::::::::::::::::::: 56 3.3.3 Recursive Rules::::::::::::::::::::::::::::::::::::::::::: 56 3.4 Defining Language Semantics :::::::::::::::::::::::::::::::::: 57 3.4.1 Data Types of Semantic Values ::::::::::::::::::::::::::: 57 3.4.2 More Than One Value Type :::::::::::::::::::::::::::::: 58 3.4.3 Generating the Semantic Value Type:::::::::::::::::::::: 58 3.4.4 The Union Declaration ::::::::::::::::::::::::::::::::::: 59 3.4.5 Providing a Structured Semantic Value Type:::::::::::::: 60 3.4.6 Actions::::::::::::::::::::::::::::::::::::::::::::::::::: 60 3.4.7 Data Types of Values in Actions :::::::::::::::::::::::::: 62 3.4.8 Actions in Midrule:::::::::::::::::::::::::::::::::::::::: 62 3.4.8.1 Using Midrule Actions ::::::::::::::::::::::::::::::: 62 3.4.8.2 Typed Midrule Actions :::::::::::::::::::::::::::::: 64 3.4.8.3 Midrule Action Translation :::::::::::::::::::::::::: 64 3.4.8.4 Conflicts due to Midrule Actions ::::::::::::::::::::: 66 3.5 Tracking Locations :::::::::::::::::::::::::::::::::::::::::::: 67 3.5.1 Data Type of Locations::::::::::::::::::::::::::::::::::: 67 3.5.2 Actions and Locations :::::::::::::::::::::::::::::::::::: 68 3.5.3 Printing Locations :::::::::::::::::::::::::::::::::::::::: 69 3.5.4 Default Action for Locations :::::::::::::::::::::::::::::: 69 3.6 Named References ::::::::::::::::::::::::::::::::::::::::::::: 70 3.7 Bison Declarations :::::::::::::::::::::::::::::::::::::::::::: 71 3.7.1 Require a Version of Bison :::::::::::::::::::::::::::::::: 72 3.7.2 Token Kind Names ::::::::::::::::::::::::::::::::::::::: 72 3.7.3 Operator Precedence:::::::::::::::::::::::::::::::::::::: 73 3.7.4 Nonterminal Symbols ::::::::::::::::::::::::::::::::::::: 74 3.7.5 Syntax of Symbol Declarations:::::::::::::::::::::::::::: 74 3.7.6 Performing Actions before Parsing :::::::::::::::::::::::: 74 3.7.7 Freeing Discarded Symbols:::::::::::::::::::::::::::::::: 75 iii 3.7.8 Printing Semantic Values ::::::::::::::::::::::::::::::::: 76 3.7.9 Suppressing Conflict Warnings :::::::::::::::::::::::::::: 77 3.7.10 The Start-Symbol ::::::::::::::::::::::::::::::::::::::: 79 3.7.11 A Pure (Reentrant) Parser::::::::::::::::::::::::::::::: 79 3.7.12 A Push Parser::::::::::::::::::::::::::::::::::::::::::: 79 3.7.13 Bison Declaration Summary ::::::::::::::::::::::::::::: 81 3.7.14 %define Summary ::::::::::::::::::::::::::::::::::::::: 85 3.7.15 %code Summary :::::::::::::::::::::::::::::::::::::::: 95 3.8 Multiple Parsers in the Same Program ::::::::::::::::::::::::: 97 4 Parser C-Language Interface :::::::::::::::::: 99 4.1 The Parser Function yyparse:::::::::::::::::::::::::::::::::: 99 4.2 Push Parser Interface::::::::::::::::::::::::::::::::::::::::: 100 4.3 The Lexical Analyzer Function yylex::::::::::::::::::::::::: 101 4.3.1 Calling Convention for yylex :::::::::::::::::::::::::::: 101 4.3.2 Special Tokens :::::::::::::::::::::::::::::::::::::::::: 102 4.3.3 Finding Tokens by String Literals :::::::::::::::::::::::: 103 4.3.4 Semantic Values of Tokens ::::::::::::::::::::::::::::::: 103 4.3.5 Textual Locations of Tokens ::::::::::::::::::::::::::::: 103 4.3.6 Calling Conventions for Pure Parsers :::::::::::::::::::: 104 4.4 Error Reporting :::::::::::::::::::::::::::::::::::::::::::::: 105 4.4.1 The Error Reporting Function yyerror :::::::::::::::::: 105 4.4.2 The Syntax Error Reporting Function yyreport_syntax_error ::::::::::::::::::::::::::: 106 4.5 Special Features for Use in Actions ::::::::::::::::::::::::::: 108 4.6 Parser Internationalization ::::::::::::::::::::::::::::::::::: 110 4.6.1 Enabling Internationalization :::::::::::::::::::::::::::: 110 4.6.2 Token Internationalization ::::::::::::::::::::::::::::::: 111 5 The Bison Parser Algorithm ::::::::::::::::: 112 5.1 Lookahead Tokens :::::::::::::::::::::::::::::::::::::::::::: 112 5.2 Shift/Reduce Conflicts ::::::::::::::::::::::::::::::::::::::: 113 5.3 Operator Precedence ::::::::::::::::::::::::::::::::::::::::: 115 5.3.1 When Precedence is Needed ::::::::::::::::::::::::::::: 115 5.3.2 Specifying Operator Precedence:::::::::::::::::::::::::: 115 5.3.3 Specifying Precedence Only :::::::::::::::::::::::::::::: 116 5.3.4 Precedence Examples :::::::::::::::::::::::::::::::::::: 116 5.3.5 How Precedence Works :::::::::::::::::::::::::::::::::: 117 5.3.6 Using Precedence For Non Operators :::::::::::::::::::: 117 5.4 Context-Dependent Precedence ::::::::::::::::::::::::::::::: 117 5.5 Parser States ::::::::::::::::::::::::::::::::::::::::::::::::: 118 5.6 Reduce/Reduce Conflicts ::::::::::::::::::::::::::::::::::::: 118 5.7 Mysterious Conflicts:::::::::::::::::::::::::::::::::::::::::: 121 5.8 Tuning LR ::::::::::::::::::::::::::::::::::::::::::::::::::: 123 5.8.1 LR Table Construction :::::::::::::::::::::::::::::::::: 123 5.8.2
Recommended publications
  • Ethereal Developer's Guide Draft 0.0.2 (15684) for Ethereal 0.10.11
    Ethereal Developer's Guide Draft 0.0.2 (15684) for Ethereal 0.10.11 Ulf Lamping, Ethereal Developer's Guide: Draft 0.0.2 (15684) for Ethere- al 0.10.11 by Ulf Lamping Copyright © 2004-2005 Ulf Lamping Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or any later version published by the Free Software Foundation. All logos and trademarks in this document are property of their respective owner. Table of Contents Preface .............................................................................................................................. vii 1. Foreword ............................................................................................................... vii 2. Who should read this document? ............................................................................... viii 3. Acknowledgements ................................................................................................... ix 4. About this document .................................................................................................. x 5. Where to get the latest copy of this document? ............................................................... xi 6. Providing feedback about this document ...................................................................... xii I. Ethereal Build Environment ................................................................................................14 1. Introduction .............................................................................................................15
    [Show full text]
  • A Compiler Front-End for the WOOL Parallelization Library
    A compiler front-end for the WOOL Parallelization library GEORGIOS VARISTEAS KTH Information and Communication Technology Master of Science Thesis Stockholm, Sweden 2010 TRITA-ICT-EX-2010:291 Royal Institute of Technology A compiler front-end for the WOOL Parallelization library Georgios Varisteas yorgos(@)kth.se 15 October, 2010 A master thesis project conducted at Examiner: Mats Brorsson Supervisor: Karl-Filip Faxén Abstract WOOL is a C parallelization library developed at SICS by Karl-Filip Faxén. It provides the tools for develop- ing fine grained independent task based parallel applications. This library is distinguished from other similar projects by being really fast and light; it manages to spawn and synchronize tasks in under 20 cycles. However, all software development frameworks which expose radically new functionality to a programming language, gain a lot by having a compiler to encapsulate and implement them. WOOL does not differ from this category. This project is about the development of a source-to-source compiler for the WOOL parallelization library, supporting an extension of the C language with new syntax that implements the WOOL API, transform- ing it and eventually outputting GNU C code. Additionally, this compiler is augmented with a wrapper script that performs compilation to machine code by using GCC. This script is configurable and fully automatic. The main advantage gained from this project is to satisfy the need for less overhead in software development with WOOL. The simplified syntax results in faster and more economical code writing while being less error- prone. Moreover, this compiler enables the future addition of many more features not applicable with the current state of WOOL as a library.
    [Show full text]
  • Chapter # 9 LEX and YACC
    Chapter # 9 LEX and YACC Dr. Shaukat Ali Department of Computer Science University of Peshawar Lex and Yacc Lex and yacc are a matched pair of tools. Lex breaks down files into sets of "tokens," roughly analogous to words. Yacc takes sets of tokens and assembles them into higher-level constructs, analogous to sentences. Lex's output is mostly designed to be fed into some kind of parser. Yacc is designed to work with the output of Lex. 2 Lex and Yacc Lex and yacc are tools for building programs. Their output is itself code – Which needs to be fed into a compiler – May be additional user code is added to use the code generated by lex and yacc 3 Lex : A lexical analyzer generator Lex is a program designed to generate scanners, also known as tokenizers, which recognize lexical patterns in text Lex is an acronym that stands for "lexical analyzer generator.“ The main purpose is to facilitate lexical analysis The processing of character sequences in source code to produce tokens for use as input to other programs such as parsers Another tool for lexical analyzer generation is Flex 4 Lex : A lexical analyzer generator lex.lex is an a input file written in a language which describes the generation of lexical analyzer. The lex compiler transforms lex.l to a C program known as lex.yy.c. lex.yy.c is compiled by the C compiler to a file called a.out. The output of C compiler is the working lexical analyzer which takes stream of input characters and produces a stream of tokens.
    [Show full text]
  • Project1: Build a Small Scanner/Parser
    Project1: Build A Small Scanner/Parser Introducing Lex, Yacc, and POET cs5363 1 Project1: Building A Scanner/Parser Parse a subset of the C language Support two types of atomic values: int float Support one type of compound values: arrays Support a basic set of language concepts Variable declarations (int, float, and array variables) Expressions (arithmetic and boolean operations) Statements (assignments, conditionals, and loops) You can choose a different but equivalent language Need to make your own test cases Options of implementation (links available at class web site) Manual in C/C++/Java (or whatever other lang.) Lex and Yacc (together with C/C++) POET: a scripting compiler writing language Or any other approach you choose --- must document how to download/use any tools involved cs5363 2 This is just starting… There will be two other sub-projects Type checking Check the types of expressions in the input program Optimization/analysis/translation Do something with the input code, output the result The starting project is important because it determines which language you can use for the other projects Lex+Yacc ===> can work only with C/C++ POET ==> work with POET Manual ==> stick to whatever language you pick This class: introduce Lex/Yacc/POET to you cs5363 3 Using Lex to build scanners lex.yy.c MyLex.l lex/flex lex.yy.c a.out gcc/cc Input stream a.out tokens Write a lex specification Save it in a file (MyLex.l) Compile the lex specification file by invoking lex/flex lex MyLex.l A lex.yy.c file is generated
    [Show full text]
  • GNU M4, Version 1.4.7 a Powerful Macro Processor Edition 1.4.7, 23 September 2006
    GNU M4, version 1.4.7 A powerful macro processor Edition 1.4.7, 23 September 2006 by Ren´eSeindal This manual is for GNU M4 (version 1.4.7, 23 September 2006), a package containing an implementation of the m4 macro language. Copyright c 1989, 1990, 1991, 1992, 1993, 1994, 2004, 2005, 2006 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled “GNU Free Documentation License.” i Table of Contents 1 Introduction and preliminaries ................ 3 1.1 Introduction to m4 ............................................. 3 1.2 Historical references ............................................ 3 1.3 Invoking m4 .................................................... 4 1.4 Problems and bugs ............................................. 8 1.5 Using this manual .............................................. 8 2 Lexical and syntactic conventions ............ 11 2.1 Macro names ................................................. 11 2.2 Quoting input to m4........................................... 11 2.3 Comments in m4 input ........................................ 11 2.4 Other kinds of input tokens ................................... 12 2.5 How m4 copies input to output ................................ 12 3 How to invoke macros........................
    [Show full text]
  • User Manual for Ox: an Attribute-Grammar Compiling System Based on Yacc, Lex, and C Kurt M
    Computer Science Technical Reports Computer Science 12-1992 User Manual for Ox: An Attribute-Grammar Compiling System based on Yacc, Lex, and C Kurt M. Bischoff Iowa State University Follow this and additional works at: http://lib.dr.iastate.edu/cs_techreports Part of the Programming Languages and Compilers Commons Recommended Citation Bischoff, Kurt M., "User Manual for Ox: An Attribute-Grammar Compiling System based on Yacc, Lex, and C" (1992). Computer Science Technical Reports. 21. http://lib.dr.iastate.edu/cs_techreports/21 This Article is brought to you for free and open access by the Computer Science at Iowa State University Digital Repository. It has been accepted for inclusion in Computer Science Technical Reports by an authorized administrator of Iowa State University Digital Repository. For more information, please contact [email protected]. User Manual for Ox: An Attribute-Grammar Compiling System based on Yacc, Lex, and C Abstract Ox generalizes the function of Yacc in the way that attribute grammars generalize context-free grammars. Ordinary Yacc and Lex specifications may be augmented with definitions of synthesized and inherited attributes written in C syntax. From these specifications, Ox generates a program that builds and decorates attributed parse trees. Ox accepts a most general class of attribute grammars. The user may specify postdecoration traversals for easy ordering of side effects such as code generation. Ox handles the tedious and error-prone details of writing code for parse-tree management, so its use eases problems of security and maintainability associated with that aspect of translator development. The translators generated by Ox use internal memory management that is often much faster than the common technique of calling malloc once for each parse-tree node.
    [Show full text]
  • GNU M4, Version 1.4.19 a Powerful Macro Processor Edition 1.4.19, 28 May 2021
    GNU M4, version 1.4.19 A powerful macro processor Edition 1.4.19, 28 May 2021 by Ren´eSeindal, Fran¸coisPinard, Gary V. Vaughan, and Eric Blake ([email protected]) This manual (28 May 2021) is for GNU M4 (version 1.4.19), a package containing an implementation of the m4 macro language. Copyright c 1989{1994, 2004{2014, 2016{2017, 2020{2021 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled \GNU Free Documentation License." i Table of Contents 1 Introduction and preliminaries ::::::::::::::::: 3 1.1 Introduction to m4 :::::::::::::::::::::::::::::::::::::::::::::: 3 1.2 Historical references :::::::::::::::::::::::::::::::::::::::::::: 3 1.3 Problems and bugs ::::::::::::::::::::::::::::::::::::::::::::: 4 1.4 Using this manual :::::::::::::::::::::::::::::::::::::::::::::: 5 2 Invoking m4::::::::::::::::::::::::::::::::::::::: 7 2.1 Command line options for operation modes ::::::::::::::::::::: 7 2.2 Command line options for preprocessor features ::::::::::::::::: 8 2.3 Command line options for limits control ::::::::::::::::::::::: 10 2.4 Command line options for frozen state ::::::::::::::::::::::::: 11 2.5 Command line options for debugging :::::::::::::::::::::::::: 11 2.6 Specifying input files on the command line :::::::::::::::::::::
    [Show full text]
  • LFS-8.4-Fr.Pdf
    Linux From Scratch Version 8.4 Créé par Gerard Beekmans Rédacteur en chef : Bruce Dubbs Linux From Scratch: Version 8.4 par Créé par Gerard Beekmans et Rédacteur en chef : Bruce Dubbs Copyright © 1999-2019 Gerard Beekmans Copyright © 1999-2019, Gerard Beekmans Tous droits réservés. Ce livre est distribué sous la Creative Commons License. Les instructions d'ordinateur peuvent être extraites du livre sous la MIT License. Linux® est une marque déposée de Linus Torvalds. Linux From Scratch - Version 8.4 Table des matières Préface ................................................................................................................................................................... viii i. Avant-propos ................................................................................................................................................ viii ii. Public visé ..................................................................................................................................................... ix iii. Architectures cibles de LFS ........................................................................................................................ ix iv. LFS et les standards ...................................................................................................................................... x v. Raison de la présence des paquets dans le livre .......................................................................................... xi vi. Prérequis ...................................................................................................................................................
    [Show full text]
  • Cisco UCS C240 M4 SFF Rack Server Spec Sheet
    This Product has been discontinued Spec Sheet Cisco UCS C240 M4 High-Density Rack Server (Small Form Factor Disk Drive Model) CISCO SYSTEMS PUBLICATION HISTORY 170 WEST TASMAN DR. SAN JOSE, CA, 95134 REV E.20 MARCH 23, 2021 WWW.CISCO.COM CONTENTS OVERVIEW . 5 DETAILED VIEWS . 6 Chassis Front View . .6 Chassis Rear View . .9 BASE SERVER STANDARD CAPABILITIES and FEATURES . 11 CONFIGURING the SERVER . 15 STEP 1 VERIFY SERVER SKU . 16 STEP 2 SELECT RISER CARDS (OPTIONAL) . 17 STEP 3 SELECT LOCKING SECURITY BEZEL (OPTIONAL) . 18 STEP 4 SELECT CPU(s) . 19 STEP 5 SELECT MEMORY . 21 STEP 6 SELECT RAID CONTROLLERS . 27 RAID Controller Options (internal HDD/SSD support) . 27 Embedded Software RAID . 27 Cisco 12G SAS Modular RAID Controller . 27 SAS HBA (internal HDD/SSD/JBOD support) . 27 SAS HBA (external JBOD support) . 27 RAID Volumes and Groups . 28 STEP 7 SELECT HARD DISK DRIVES (HDDs) or SOLID STATE DRIVES (SSDs) . 39 STEP 8 SELECT SED HARD DISK DRIVES (HDDs) or SOLID STATE DRIVES (SSDs) . 45 STEP 9 SELECT PCIe OPTION CARD(s) . 48 STEP 10 ORDER OPTIONAL NETWORK CARD ACCESSORIES . 53 STEP 11 ORDER GPU CARDS AND GPU POWER CABLES (OPTIONAL) . 58 STEP 12 ORDER POWER SUPPLY . 61 STEP 13 SELECT AC POWER CORD(s) . 62 STEP 14 ORDER TOOL-LESS RAIL KIT AND OPTIONAL REVERSIBLE CABLE MANAGEMENT ARM . 65 STEP 15 SELECT NIC MODE (OPTIONAL) . 66 STEP 16 ORDER A TRUSTED PLATFORM MODULE (OPTIONAL) . 67 STEP 17 ORDER CISCO FLEXIBLE FLASH SD CARD MODULE (OPTIONAL) . 69 STEP 18 ORDER OPTIONAL USB 3.0 DRIVE .
    [Show full text]
  • Yacc a Tool for Syntactic Analysis
    1 Yacc a tool for Syntactic Analysis CS 315 – Programming Languages Pinar Duygulu Bilkent University CS315 Programming Languages © Pinar Duygulu Lex and Yacc 2 1) Lexical Analysis: Lexical analyzer: scans the input stream and converts sequences of characters into tokens. Lex is a tool for writing lexical analyzers. 2) Syntactic Analysis (Parsing): Parser: reads tokens and assembles them into language constructs using the grammar rules of the language. Yacc is a tool for constructing parsers. Yet Another Compiler to Compiler Reads a specification file that codifies the grammar of a language and generates a parsing routine CS315 Programming Languages © Pinar Duygulu 3 Yacc • Yacc specification describes a Context Free Grammar (CFG), that can be used to generate a parser. Elements of a CFG: 1. Terminals: tokens and literal characters, 2. Variables (nonterminals): syntactical elements, 3. Production rules, and 4. Start rule. CS315 Programming Languages © Pinar Duygulu 4 Yacc Format of a production rule: symbol: definition {action} ; Example: A → Bc is written in yacc as a: b 'c'; CS315 Programming Languages © Pinar Duygulu 5 Yacc Format of a yacc specification file: declarations %% grammar rules and associated actions %% C programs CS315 Programming Languages © Pinar Duygulu 6 Declarations To define tokens and their characteristics %token: declare names of tokens %left: define left-associative operators %right: define right-associative operators %nonassoc: define operators that may not associate with themselves %type: declare the type of variables %union: declare multiple data types for semantic values %start: declare the start symbol (default is the first variable in rules) %prec: assign precedence to a rule %{ C declarations directly copied to the resulting C program %} (E.g., variables, types, macros…) CS315 Programming Languages © Pinar Duygulu 7 A simple yacc specification to accept L={ anbn | n>1}.
    [Show full text]
  • Binpac: a Yacc for Writing Application Protocol Parsers
    binpac: A yacc for Writing Application Protocol Parsers Ruoming Pang∗ Vern Paxson Google, Inc. International Computer Science Institute and New York, NY, USA Lawrence Berkeley National Laboratory [email protected] Berkeley, CA, USA [email protected] Robin Sommer Larry Peterson International Computer Science Institute Princeton University Berkeley, CA, USA Princeton, NJ, USA [email protected] [email protected] ABSTRACT Similarly, studies of Email traffic [21, 46], peer-to-peer applica- A key step in the semantic analysis of network traffic is to parse the tions [37], online gaming, and Internet attacks [29] require under- traffic stream according to the high-level protocols it contains. This standing application-level traffic semantics. However, it is tedious, process transforms raw bytes into structured, typed, and semanti- error-prone, and sometimes prohibitively time-consuming to build cally meaningful data fields that provide a high-level representation application-level analysis tools from scratch, due to the complexity of the traffic. However, constructing protocol parsers by hand is a of dealing with low-level traffic data. tedious and error-prone affair due to the complexity and sheer num- We can significantly simplify the process if we can leverage a ber of application protocols. common platform for various kinds of application-level traffic anal- This paper presents binpac, a declarative language and com- ysis. A key element of such a platform is application-protocol piler designed to simplify the task of constructing robust and effi- parsers that translate packet streams into high-level representations cient semantic analyzers for complex network protocols. We dis- of the traffic, on top of which we can then use measurement scripts cuss the design of the binpac language and a range of issues that manipulate semantically meaningful data elements such as in generating efficient parsers from high-level specifications.
    [Show full text]
  • AWK-4121 Hardware Installation Guide Moxa Airworks
    AWK-4121 Hardware Installation Guide Moxa AirWorks Fourth Edition, October 2010 2010 Moxa Inc. All rights reserved. Reproduction without permission is prohibited. P/N: 1802041210013 Notes for the Reader WARNING Indicates that death or personal injury may occur if proper precautions are not taken. ATTENTION Indicates that possible damage to this product or your property may result if proper precautions are not taken. NOTE Highlights important information related to this product. Package Checklist Moxa’s AWK-4121 is shipped with the following items. If any of these items is missing or damaged, please contact your customer service representative for assistance. • AWK-4121 • 2 omni-directional antennas (2/5 dBi, N-type male, 2.4/5 GHz) • Wall mounting kit • Field-installable power plug • Field-installable RJ45 plug • Metal cap to cover M12 female DI/O connector • Metal cap to cover RJ45 connector • Documentation and software CD • Quick installation guide (printed) • Warranty card NOTE The above items come with the AWK-4121 standard version. The package contents for customized versions may be different. Installation Before installing the AWK-4121, make sure that all items in the Package Checklist are in the box. In addition, you will need access to a notebook computer or PC equipped with an Ethernet port. The AWK-4121 has a default IP address, user name and password that you must use when resetting or connecting to your AWK-4121 device. Default IP address: 192.168.127.253 User name: admin Password: root Please read “Chapter2 Getting Started” in AWK-4121 User’s Manual for more details about installation and configuration.
    [Show full text]