Skip to content

Commit b7247bd

Browse files
committed
Add visitor for ExternFrameStatement to parser.
1 parent c7ca174 commit b7247bd

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

source/openpulse/openpulse/ast.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,15 @@ class CalibrationBlock(QASMNode):
131131
body: List[Statement]
132132

133133

134+
@dataclass
135+
class ExternFrameStatement(QASMNode):
136+
"""
137+
Node representing an extern frame statement.
138+
"""
139+
140+
name: Identifier
141+
142+
134143
@dataclass
135144
class ExternPortStatement(QASMNode):
136145
"""

source/openpulse/openpulse/parser.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ def visitCalibrationBlock(self, ctx: openpulseParser.CalibrationBlockContext):
195195
body=[self.visit(statement) for statement in ctx.openpulseStatement()]
196196
)
197197

198+
def visitExternFrameStatement(self, ctx: openpulseParser.OpenpulseStatementContext):
199+
return openpulse_ast.ExternFrameStatement(name=_visit_identifier(ctx.Identifier()))
200+
198201
def visitExternPortStatement(self, ctx: openpulseParser.OpenpulseStatementContext):
199202
return openpulse_ast.ExternPortStatement(name=_visit_identifier(ctx.Identifier()))
200203

0 commit comments

Comments
 (0)