Bug 246559 - [WGSL] Flesh out WGSL AST
Summary: [WGSL] Flesh out WGSL AST
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dan Glastonbury
URL:
Keywords: InRadar
Depends on:
Blocks: 246558
  Show dependency treegraph
 
Reported: 2022-10-14 21:15 PDT by Dan Glastonbury
Modified: 2023-01-31 21:37 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Glastonbury 2022-10-14 21:15:00 PDT
Only a partial AST is implemented.  After studying the WGSL specification, I propose:

```
Node
|- Attribute
|  |- AlignAttribute
|  |- BindingAttribute
|  |- BuiltinAttribute
|  |- ConstAttribute
|  |- GroupAttribute
|  |- IdAttribute
|  |- InterpolateAttribute
|  |- InvariantAttribute
|  |- LocationAttribute
|  |- SizeAttribute
|  |- StageAttribute
|  |- WorkgroupSizeAttribute
|- Directive
|- Expression
|  |- BinaryExpression
|  |- BitcastExpression
|  |- IndexAccessExpression
|  |- CallExpression
|  |- IdentiferExpression
|  |- LiteralExpression
|  |  |- BoolLiteral
|  |  |- FloatLiteral
|  |  |- IntegerLiteral
|  |- FieldAccessExpression
|  |- UnaryExpression
|- Function
|- ShaderModule
|- Statement
|  |- AssignmentStatement
|  |- BreakStatement
|  |- CallStatement
|  |- CompoundAssignmentStatement
|  |- CompoundStatement
|  |- ContinueStatement
|  |- DecrementStatement
|  |- DiscardStatement
|  |- ForStatement
|  |- IfStatement
|  |- IncrementStatement
|  |- LoopStatement
|  |- ReturnStatement
|  |- StaticAssertStatement
|  |- SwitchStatement
|  |- VariableStatement
|  |- WhileStatement
|- Structure
|- StructureMember
|- TypeAlias
|- TypeName
|  |- ArrayTypeName
|  |- NamedTypeName
|  |- ParameterizedTypeName
|- Value
|  |- ConstantValue
|  |- OverrideValue
|  |- LetValue
|  |- ParameterValue
|- Variable
|- VariableQualifier

```
Comment 1 Radar WebKit Bug Importer 2022-10-14 21:15:33 PDT
<rdar://problem/101198259>
Comment 2 Dan Glastonbury 2023-01-31 00:29:08 PST
Pull request: https://github.com/WebKit/WebKit/pull/9369
Comment 3 EWS 2023-01-31 21:36:58 PST
Committed 259661@main (664eceb30ec0): <https://commits.webkit.org/259661@main>

Reviewed commits have been landed. Closing PR #9369 and removing active labels.