📄 aslcompiler.y
字号:
%token <i> PARSEOP_RETURN%token <i> PARSEOP_REVISION%token <i> PARSEOP_SCOPE%token <i> PARSEOP_SERIALIZERULE_NOTSERIAL%token <i> PARSEOP_SERIALIZERULE_SERIAL%token <i> PARSEOP_SHARETYPE_EXCLUSIVE%token <i> PARSEOP_SHARETYPE_SHARED%token <i> PARSEOP_SHIFTLEFT%token <i> PARSEOP_SHIFTRIGHT%token <i> PARSEOP_SIGNAL%token <i> PARSEOP_SIZEOF%token <i> PARSEOP_SLEEP%token <i> PARSEOP_STALL%token <i> PARSEOP_STARTDEPENDENTFN%token <i> PARSEOP_STARTDEPENDENTFN_NOPRI%token <i> PARSEOP_STORE%token <s> PARSEOP_STRING_LITERAL%token <i> PARSEOP_SUBTRACT%token <i> PARSEOP_SWITCH%token <i> PARSEOP_THERMALZONE%token <i> PARSEOP_TIMER%token <i> PARSEOP_TOBCD%token <i> PARSEOP_TOBUFFER%token <i> PARSEOP_TODECIMALSTRING%token <i> PARSEOP_TOHEXSTRING%token <i> PARSEOP_TOINTEGER%token <i> PARSEOP_TOSTRING%token <i> PARSEOP_TOUUID%token <i> PARSEOP_TRANSLATIONTYPE_DENSE%token <i> PARSEOP_TRANSLATIONTYPE_SPARSE%token <i> PARSEOP_TYPE_STATIC%token <i> PARSEOP_TYPE_TRANSLATION%token <i> PARSEOP_UNICODE%token <i> PARSEOP_UNLOAD%token <i> PARSEOP_UPDATERULE_ONES%token <i> PARSEOP_UPDATERULE_PRESERVE%token <i> PARSEOP_UPDATERULE_ZEROS%token <i> PARSEOP_VAR_PACKAGE%token <i> PARSEOP_VENDORLONG%token <i> PARSEOP_VENDORSHORT%token <i> PARSEOP_WAIT%token <i> PARSEOP_WHILE%token <i> PARSEOP_WORDBUSNUMBER%token <i> PARSEOP_WORDCONST%token <i> PARSEOP_WORDIO%token <i> PARSEOP_WORDSPACE%token <i> PARSEOP_XFERTYPE_8%token <i> PARSEOP_XFERTYPE_8_16%token <i> PARSEOP_XFERTYPE_16%token <i> PARSEOP_XOR%token <i> PARSEOP_ZERO/* * Production names */%type <n> ASLCode%type <n> DefinitionBlockTerm%type <n> TermList%type <n> Term%type <n> CompilerDirective%type <n> ObjectList%type <n> Object%type <n> DataObject%type <n> BufferData%type <n> PackageData%type <n> IntegerData%type <n> StringData%type <n> NamedObject%type <n> NameSpaceModifier%type <n> UserTerm%type <n> ArgList%type <n> TermArg%type <n> Target%type <n> RequiredTarget%type <n> SimpleTarget%type <n> BufferTermData%type <n> ParameterTypePackage%type <n> ParameterTypePackageList%type <n> ParameterTypesPackage%type <n> ParameterTypesPackageList%type <n> Type1Opcode%type <n> Type2Opcode%type <n> Type2IntegerOpcode%type <n> Type2StringOpcode%type <n> Type2BufferOpcode%type <n> Type2BufferOrStringOpcode%type <n> Type3Opcode/* Obsolete %type <n> Type4Opcode */%type <n> Type5Opcode%type <n> Type6Opcode%type <n> LineTerm%type <n> IncludeTerm%type <n> IncludeCStyleTerm%type <n> ExternalTerm%type <n> FieldUnitList%type <n> FieldUnit%type <n> FieldUnitEntry%type <n> OffsetTerm%type <n> AccessAsTerm%type <n> OptionalAccessAttribTerm/* Named Objects */%type <n> BankFieldTerm%type <n> CreateBitFieldTerm%type <n> CreateByteFieldTerm%type <n> CreateDWordFieldTerm%type <n> CreateFieldTerm%type <n> CreateQWordFieldTerm%type <n> CreateWordFieldTerm%type <n> DataRegionTerm%type <n> DeviceTerm%type <n> EventTerm%type <n> FieldTerm%type <n> FunctionTerm%type <n> IndexFieldTerm%type <n> MethodTerm%type <n> MutexTerm%type <n> OpRegionTerm%type <n> OpRegionSpaceIdTerm%type <n> PowerResTerm%type <n> ProcessorTerm%type <n> ThermalZoneTerm/* Namespace modifiers */%type <n> AliasTerm%type <n> NameTerm%type <n> ScopeTerm/* Type 1 opcodes */%type <n> BreakTerm%type <n> BreakPointTerm%type <n> ContinueTerm%type <n> FatalTerm%type <n> IfElseTerm%type <n> IfTerm%type <n> ElseTerm%type <n> LoadTerm%type <n> NoOpTerm%type <n> NotifyTerm%type <n> ReleaseTerm%type <n> ResetTerm%type <n> ReturnTerm%type <n> SignalTerm%type <n> SleepTerm%type <n> StallTerm%type <n> SwitchTerm%type <n> CaseDefaultTermList//%type <n> CaseTermList%type <n> CaseTerm%type <n> DefaultTerm%type <n> UnloadTerm%type <n> WhileTerm/* Type 2 opcodes */%type <n> AcquireTerm%type <n> AddTerm%type <n> AndTerm%type <n> ConcatTerm%type <n> ConcatResTerm%type <n> CondRefOfTerm%type <n> CopyObjectTerm%type <n> DecTerm%type <n> DerefOfTerm%type <n> DivideTerm%type <n> FindSetLeftBitTerm%type <n> FindSetRightBitTerm%type <n> FromBCDTerm%type <n> IncTerm%type <n> IndexTerm%type <n> LAndTerm%type <n> LEqualTerm%type <n> LGreaterTerm%type <n> LGreaterEqualTerm%type <n> LLessTerm%type <n> LLessEqualTerm%type <n> LNotTerm%type <n> LNotEqualTerm%type <n> LoadTableTerm%type <n> LOrTerm%type <n> MatchTerm%type <n> MidTerm%type <n> ModTerm%type <n> MultiplyTerm%type <n> NAndTerm%type <n> NOrTerm%type <n> NotTerm%type <n> ObjectTypeTerm%type <n> OrTerm%type <n> RefOfTerm%type <n> ShiftLeftTerm%type <n> ShiftRightTerm%type <n> SizeOfTerm%type <n> StoreTerm%type <n> SubtractTerm%type <n> TimerTerm%type <n> ToBCDTerm%type <n> ToBufferTerm%type <n> ToDecimalStringTerm%type <n> ToHexStringTerm%type <n> ToIntegerTerm%type <n> ToStringTerm%type <n> WaitTerm%type <n> XOrTerm%type <n> OptionalTermArg%type <n> OptionalReturnArg%type <n> OptionalListString/* Keywords */%type <n> ObjectTypeKeyword%type <n> AccessTypeKeyword%type <n> AccessAttribKeyword%type <n> LockRuleKeyword%type <n> UpdateRuleKeyword%type <n> RegionSpaceKeyword%type <n> AddressSpaceKeyword%type <n> MatchOpKeyword%type <n> SerializeRuleKeyword%type <n> DMATypeKeyword%type <n> OptionalBusMasterKeyword%type <n> XferTypeKeyword%type <n> ResourceTypeKeyword%type <n> MinKeyword%type <n> MaxKeyword%type <n> DecodeKeyword%type <n> RangeTypeKeyword%type <n> MemTypeKeyword%type <n> OptionalReadWriteKeyword%type <n> InterruptTypeKeyword%type <n> InterruptLevel%type <n> ShareTypeKeyword%type <n> IODecodeKeyword%type <n> TypeKeyword%type <n> TranslationKeyword%type <n> AddressKeyword/* Types */%type <n> SuperName%type <n> ArgTerm%type <n> LocalTerm%type <n> DebugTerm%type <n> Integer%type <n> ByteConst%type <n> WordConst%type <n> DWordConst%type <n> QWordConst%type <n> String%type <n> ConstTerm%type <n> ByteConstExpr%type <n> WordConstExpr%type <n> DWordConstExpr%type <n> QWordConstExpr%type <n> ConstExprTerm%type <n> BufferTerm%type <n> ByteList%type <n> DWordList%type <n> PackageTerm%type <n> PackageList%type <n> PackageElement%type <n> VarPackageLengthTerm/* Macros */%type <n> EISAIDTerm%type <n> ResourceTemplateTerm%type <n> ToUUIDTerm%type <n> UnicodeTerm%type <n> ResourceMacroList%type <n> ResourceMacroTerm%type <n> DMATerm%type <n> DWordIOTerm%type <n> DWordMemoryTerm%type <n> DWordSpaceTerm%type <n> EndDependentFnTerm%type <n> ExtendedIOTerm%type <n> ExtendedMemoryTerm%type <n> ExtendedSpaceTerm%type <n> FixedIOTerm%type <n> InterruptTerm%type <n> IOTerm%type <n> IRQNoFlagsTerm%type <n> IRQTerm%type <n> Memory24Term%type <n> Memory32FixedTerm%type <n> Memory32Term%type <n> QWordIOTerm%type <n> QWordMemoryTerm%type <n> QWordSpaceTerm%type <n> RegisterTerm%type <n> StartDependentFnTerm%type <n> StartDependentFnNoPriTerm%type <n> VendorLongTerm%type <n> VendorShortTerm%type <n> WordBusNumberTerm%type <n> WordIOTerm%type <n> WordSpaceTerm%type <n> NameString%type <n> NameSeg/* Local types that help construct the AML, not in ACPI spec */%type <n> IncludeEndTerm%type <n> AmlPackageLengthTerm%type <n> OptionalByteConstExpr%type <n> OptionalDWordConstExpr%type <n> OptionalQWordConstExpr%type <n> OptionalSerializeRuleKeyword%type <n> OptionalResourceType_First%type <n> OptionalResourceType%type <n> OptionalMinType%type <n> OptionalMaxType%type <n> OptionalMemType%type <n> OptionalCount%type <n> OptionalDecodeType%type <n> OptionalRangeType%type <n> OptionalShareType%type <n> OptionalType%type <n> OptionalType_Last%type <n> OptionalTranslationType_Last%type <n> OptionalStringData%type <n> OptionalNameString%type <n> OptionalNameString_First%type <n> OptionalNameString_Last%type <n> OptionalAddressRange%type <n> OptionalObjectTypeKeyword%type <n> OptionalParameterTypePackage%type <n> OptionalParameterTypesPackage%type <n> OptionalReference%type <n> OptionalAccessSize%type <n> TermArgItem%type <n> NameStringItem%%/******************************************************************************* * * Production rules start here * ******************************************************************************//* * ASL Names *//* * Blocks, Data, and Opcodes */ASLCode : DefinitionBlockTerm | error {YYABORT; $$ = NULL;} ;DefinitionBlockTerm : PARSEOP_DEFINITIONBLOCK '(' {$$ = TrCreateLeafNode (PARSEOP_DEFINITIONBLOCK);} String ',' String ',' ByteConst ',' String ',' String ',' DWordConst ')' {TrSetEndLineNumber ($<n>3);} '{' TermList '}' {$$ = TrLinkChildren ($<n>3,7,$4,$6,$8,$10,$12,$14,$18);} ;/* ACPI 3.0 -- allow semicolons between terms */TermList : {$$ = NULL;} | TermList Term {$$ = TrLinkPeerNode (TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$2);} | TermList ';' Term {$$ = TrLinkPeerNode (TrSetNodeFlags ($1, NODE_RESULT_NOT_USED),$3);} ;Term : Object {} | Type1Opcode {} | Type2Opcode {} | Type2IntegerOpcode {} | Type2StringOpcode {} | Type2BufferOpcode {} | Type2BufferOrStringOpcode {} | error {$$ = AslDoError(); yyclearin;} ;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -