1271440Sjkim%{ 2271440Sjkim/****************************************************************************** 3271440Sjkim * 4271440Sjkim * Module Name: aslparser.y - Master Bison/Yacc input file for iASL 5271440Sjkim * 6271440Sjkim *****************************************************************************/ 7271440Sjkim 8271440Sjkim/* 9298714Sjkim * Copyright (C) 2000 - 2016, Intel Corp. 10271440Sjkim * All rights reserved. 11271440Sjkim * 12271440Sjkim * Redistribution and use in source and binary forms, with or without 13271440Sjkim * modification, are permitted provided that the following conditions 14271440Sjkim * are met: 15271440Sjkim * 1. Redistributions of source code must retain the above copyright 16271440Sjkim * notice, this list of conditions, and the following disclaimer, 17271440Sjkim * without modification. 18271440Sjkim * 2. Redistributions in binary form must reproduce at minimum a disclaimer 19271440Sjkim * substantially similar to the "NO WARRANTY" disclaimer below 20271440Sjkim * ("Disclaimer") and any redistribution must be conditioned upon 21271440Sjkim * including a substantially similar Disclaimer requirement for further 22271440Sjkim * binary redistribution. 23271440Sjkim * 3. Neither the names of the above-listed copyright holders nor the names 24271440Sjkim * of any contributors may be used to endorse or promote products derived 25271440Sjkim * from this software without specific prior written permission. 26271440Sjkim * 27271440Sjkim * Alternatively, this software may be distributed under the terms of the 28271440Sjkim * GNU General Public License ("GPL") version 2 as published by the Free 29271440Sjkim * Software Foundation. 30271440Sjkim * 31271440Sjkim * NO WARRANTY 32271440Sjkim * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 33271440Sjkim * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 34271440Sjkim * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 35271440Sjkim * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 36271440Sjkim * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 37271440Sjkim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 38271440Sjkim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 39271440Sjkim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 40271440Sjkim * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 41271440Sjkim * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 42271440Sjkim * POSSIBILITY OF SUCH DAMAGES. 43271440Sjkim */ 44271440Sjkim 45272444Sjkim#include <contrib/dev/acpica/compiler/aslcompiler.h> 46272444Sjkim#include <contrib/dev/acpica/include/acpi.h> 47272444Sjkim#include <contrib/dev/acpica/include/accommon.h> 48271440Sjkim 49271440Sjkim#define _COMPONENT ACPI_COMPILER 50271440Sjkim ACPI_MODULE_NAME ("aslparse") 51271440Sjkim 52271440Sjkim/* 53271440Sjkim * Global Notes: 54271440Sjkim * 55271440Sjkim * October 2005: The following list terms have been optimized (from the 56271440Sjkim * original ASL grammar in the ACPI specification) to force the immediate 57271440Sjkim * reduction of each list item so that the parse stack use doesn't increase on 58271440Sjkim * each list element and possibly overflow on very large lists (>4000 items). 59271440Sjkim * This dramatically reduces use of the parse stack overall. 60271440Sjkim * 61298714Sjkim * ArgList, TermList, ByteList, DWordList, PackageList, 62271440Sjkim * ResourceMacroList, and FieldUnitList 63271440Sjkim */ 64271440Sjkim 65272444Sjkimvoid * 66272444SjkimAslLocalAllocate ( 67272444Sjkim unsigned int Size); 68271440Sjkim 69271440Sjkim/* Bison/yacc configuration */ 70271440Sjkim 71271440Sjkim#define static 72271440Sjkim#undef malloc 73271440Sjkim#define malloc AslLocalAllocate 74271440Sjkim#undef alloca 75271440Sjkim#define alloca AslLocalAllocate 76271440Sjkim#define yytname AslCompilername 77271440Sjkim 78271440Sjkim#define YYINITDEPTH 600 /* State stack depth */ 79271440Sjkim#define YYDEBUG 1 /* Enable debug output */ 80271440Sjkim#define YYERROR_VERBOSE 1 /* Verbose error messages */ 81271440Sjkim#define YYFLAG -32768 82271440Sjkim 83271440Sjkim/* Define YYMALLOC/YYFREE to prevent redefinition errors */ 84271440Sjkim 85272444Sjkim#define YYMALLOC AslLocalAllocate 86272444Sjkim#define YYFREE ACPI_FREE 87271440Sjkim%} 88271440Sjkim 89271440Sjkim/* 90271440Sjkim * Declare the type of values in the grammar 91271440Sjkim */ 92271440Sjkim%union { 93271440Sjkim UINT64 i; 94271440Sjkim char *s; 95271440Sjkim ACPI_PARSE_OBJECT *n; 96271440Sjkim} 97271440Sjkim 98271440Sjkim/* 99271440Sjkim * These shift/reduce conflicts are expected. There should be zero 100271440Sjkim * reduce/reduce conflicts. 101271440Sjkim */ 102298714Sjkim%expect 101 103271440Sjkim 104271440Sjkim/*! [Begin] no source code translation */ 105271440Sjkim 106271440Sjkim/* 107271440Sjkim * The M4 macro processor is used to bring in the parser items, 108271440Sjkim * in order to keep this master file smaller, and to break up 109271440Sjkim * the various parser items. 110271440Sjkim */ 111271440Sjkimm4_define(NoEcho) 112271440Sjkim 113271440Sjkim/* Token types */ 114271440Sjkim 115271440Sjkimm4_include(asltokens.y) 116271440Sjkim 117271440Sjkim/* Production types/names */ 118271440Sjkim 119271440Sjkimm4_include(asltypes.y) 120271440Sjkim%% 121271440Sjkim 122271440Sjkim/* Production rules */ 123271440Sjkim 124271440Sjkimm4_include(aslrules.y) 125298714Sjkimm4_include(aslcstyle.y) 126298714Sjkimm4_include(aslresources.y) 127271440Sjkim%% 128271440Sjkim 129271440Sjkim/*! [End] no source code translation !*/ 130271440Sjkim 131271440Sjkim/* Local support functions in C */ 132271440Sjkim 133271440Sjkimm4_include(aslsupport.y) 134