Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge data-products branch into main #341

Merged
merged 456 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
456 commits
Select commit Hold shift + click to select a range
8e28a44
Remove separate dp code gen component
bocchino May 4, 2023
d166bb3
Fix regression in C++ code gen
bocchino May 4, 2023
9b3eb42
Fix regression in C++ code gen
bocchino May 4, 2023
fc9f9aa
Merge branch 'main' into data-products
bocchino May 17, 2023
6c50da0
Merge branch 'main' into data-products
bocchino May 17, 2023
0501e21
Add raw keyword
bocchino May 26, 2023
6d19675
Merge branch 'main' into data-products
bocchino Jun 6, 2023
4dd6793
Merge branch 'data-products' into issue-246-raw-record-type
bocchino Jun 6, 2023
8a6540d
Revise spec
bocchino Jun 7, 2023
74d3878
Revise record example
bocchino Jun 7, 2023
6fc9936
Add raw record type to AST
bocchino Jun 7, 2023
608f716
Rename field in AST
bocchino Jun 7, 2023
6a87e1d
Revise dp unit tests
bocchino Jun 7, 2023
ca58b3c
Revise parser to add raw record type
bocchino Jun 7, 2023
27b43ed
Revise code gen; update unit tests
bocchino Jun 7, 2023
ae60bff
Update dp unit tests
bocchino Jun 8, 2023
d625c5e
Regenerate docs
bocchino Jun 8, 2023
bbe7b20
Delete trailing spaces
bocchino Jun 8, 2023
e5a4b69
Merge branch 'data-products' into issue-246-raw-record-type
bocchino Jun 8, 2023
d0a9993
Remove trailing spaces
bocchino Jun 8, 2023
6e5340e
Delete trailing spaces
bocchino Jun 8, 2023
7f7dcdb
Delete trailing spaces
bocchino Jun 8, 2023
7c0c42f
Remove trailing spaces
bocchino Jun 8, 2023
fc5359d
Remove unused function
bocchino Jun 8, 2023
2125a42
Revise dp unit tests
bocchino Jun 8, 2023
f0f2d14
Merge branch 'main' into data-products
bocchino Jun 15, 2023
9d25ac9
Revise unit tests for components
bocchino Jun 15, 2023
589295b
Revise dp unit tests
bocchino Jun 15, 2023
0bb04b1
Update dp unit tests
bocchino Jun 15, 2023
5f370c5
Revise fpp-to-cpp component tests
bocchino Jun 20, 2023
f06c5af
Update fpp-to-cpp component tests
bocchino Jun 20, 2023
0613461
Reivse fpp-to-cpp component tests
bocchino Jun 20, 2023
35832b2
Revise fpp-to-cpp component tests
bocchino Jun 20, 2023
767c2ec
Revise fpp-to-cpp component unit tests
bocchino Jun 20, 2023
0e010dd
Revise fpp-to-cpp component tests
bocchino Jun 20, 2023
1e55799
Revise fpp-to-cpp component tests
bocchino Jun 20, 2023
e5f7da7
Revise annotations
bocchino Jun 20, 2023
9df56c2
Revise fpp-to-cpp component tests
bocchino Jun 20, 2023
00dbe41
Revise fpp-to-cpp component tests
bocchino Jun 20, 2023
457354e
Remove old dp tests
bocchino Jun 20, 2023
11b044c
Remove generated files
bocchino Jun 20, 2023
ab65f3e
Merge branch 'main' into data-products
bocchino Jun 20, 2023
5a1dbb0
Merge branch 'main' into data-products
bocchino Jun 20, 2023
3876dd7
Revise fpp-to-cpp component tests
bocchino Jun 21, 2023
26febd7
Revise fpp-to-cpp component tests
bocchino Jun 21, 2023
6aa3d37
Merge branch 'main' into data-products
bocchino Jun 22, 2023
9a7b7ac
Fix compilation after merge from main
bocchino Jun 22, 2023
3261274
Merge branch 'main' into data-products
bocchino Jul 11, 2023
a7b1c1e
Merge remote-tracking branch 'tiffany1618/component-impl' into data-p…
bocchino Jul 11, 2023
3579a9f
Update unit tests
bocchino Jul 11, 2023
c42766c
Merge remote-tracking branch 'tiffany1618/component-impl' into data-p…
bocchino Jul 11, 2023
dcb127f
Merge remote-tracking branch 'tiffany1618/component-impl' into data-p…
bocchino Jul 11, 2023
2136f37
Merge branch 'main' into data-products
bocchino Jul 13, 2023
efefefc
Merge branch 'main' into data-products
bocchino Jul 13, 2023
090684a
Update unit tests
bocchino Jul 13, 2023
0d82c41
Update unit test ref output
bocchino Jul 13, 2023
8c23175
Merge branch 'main' into data-products
bocchino Jul 14, 2023
2b77373
Merge branch 'main' into data-products
bocchino Jul 19, 2023
0a3761a
Merge branch 'main' into data-products
bocchino Jul 19, 2023
711b7c6
Merge branch 'main' into data-products
bocchino Jul 26, 2023
d127e6c
Merge branch 'main' into data-products
bocchino Jul 27, 2023
6873db4
Merge branch 'main' into data-products
bocchino Aug 1, 2023
97a8ca9
Merge remote-tracking branch 'elliotfayman/fpptojson' into dp-json
bocchino Aug 1, 2023
c4e1763
Update fpp-to-json
bocchino Aug 2, 2023
dcd0c4b
Merge branch 'main' into dp-json
bocchino Aug 2, 2023
cd610ac
Merge branch 'main' into data-products
bocchino Aug 3, 2023
b31f766
Merge remote-tracking branch 'tiffany1618/component-test-impl' into m…
bocchino Aug 10, 2023
6c6755e
Merge remote-tracking branch 'tiffany1618/component-test-impl' into m…
bocchino Aug 11, 2023
9f77e51
Refactor ComponentTesterBaseWriter
bocchino Aug 11, 2023
d9052d7
Merge remote-tracking branch 'tiffany1618/component-test-impl' into m…
bocchino Aug 11, 2023
652babc
Revise ComponentTesterBaseWriter
bocchino Aug 11, 2023
ccfce9a
Merge remote-tracking branch 'tiffany1618/component-test-impl' into m…
bocchino Aug 11, 2023
3b0e11c
Revise ComonentTesterBaseWriter
bocchino Aug 11, 2023
174439c
Merge branch 'main' into merge-component-test-impl
bocchino Aug 11, 2023
660892d
Merge branch 'main' into data-products
bocchino Aug 16, 2023
6e60bf0
Merge branch 'issue-311-test-port-handling' into data-products-issue-311
bocchino Aug 17, 2023
cc34881
Merge branch 'issue-311-test-port-handling' into data-products-issue-311
bocchino Aug 18, 2023
d563afe
Merge branch 'issue-311-test-port-handling' into data-products-issue-311
bocchino Aug 18, 2023
cd9df0b
Merge branch 'issue-311-test-port-handling' into data-products-issue-311
bocchino Aug 18, 2023
d90ee4f
Update unit tests
bocchino Aug 18, 2023
a744ee6
Merge branch 'main' into data-products
bocchino Aug 18, 2023
74e4b6e
Merge branch 'main' into data-products
bocchino Aug 22, 2023
8011a8c
Merge branch 'issue-312-merge-changes' into data-products
bocchino Aug 22, 2023
9bd87a9
Merge branch 'main' into data-products
bocchino Aug 29, 2023
0cdd3d6
Merge branch 'issue-318-namespace-prefix' into data-products-issue-318
bocchino Aug 29, 2023
987cb69
Update generate cpp script
bocchino Aug 29, 2023
66ba8d6
Merge branch 'issue-318-namespace-prefix' into data-products-issue-318
bocchino Aug 30, 2023
5b2ffa5
Merge branch 'issue-318-namespace-prefix' into data-products-issue-318
bocchino Aug 30, 2023
80dfd13
Revise C++ component implementations
bocchino Aug 30, 2023
c6bbc44
Merge branch 'main' into data-products
bocchino Aug 30, 2023
a0651c7
Revise generated C++ test code
bocchino Aug 31, 2023
910f1be
Revise test scripts
bocchino Aug 31, 2023
2460743
Merge branch 'main' into data-products
bocchino Sep 11, 2023
66bed46
Update test config
bocchino Sep 11, 2023
aa77b3a
Merge branch 'data-products' into issue-309-test-code
bocchino Sep 11, 2023
b8838ca
Revise component ut code gen
bocchino Sep 11, 2023
eb14847
Revise component ut code gen
bocchino Sep 11, 2023
70d3e7b
Revise component unit test code gen
bocchino Sep 11, 2023
6aea01b
Revise component unit test code gen
bocchino Sep 13, 2023
9c7ada0
Merge branch 'main' into data-products
bocchino Sep 13, 2023
c756f37
Merge branch 'data-products' into issue-309-test-code
bocchino Sep 13, 2023
4c06e9e
Revise component ut code gen
bocchino Sep 19, 2023
353f337
Revise component ut code gen
bocchino Sep 19, 2023
aaf2c8e
Revise GTestBase code gen
bocchino Sep 19, 2023
0890bf8
Revise GTestBase code gen
bocchino Sep 19, 2023
17b4616
Regenerate docs
bocchino Sep 20, 2023
1d6f5ff
Add product get port to spec
bocchino Sep 20, 2023
d0b44dd
Add product get port kind to Ast
bocchino Sep 20, 2023
53af79c
Add product get port to syntax
bocchino Sep 20, 2023
e8f7696
Revise semantics of data product ports
bocchino Sep 20, 2023
7822280
Revise fpp-check unit tests
bocchino Sep 20, 2023
59b8bfb
Update fpp-check unit tests
bocchino Sep 20, 2023
6bfe8af
Refactor component C++ code gen
bocchino Sep 21, 2023
ee3aa3b
Refactor component data product code gen
bocchino Sep 21, 2023
d96d83b
Start to add code gen for product get port
bocchino Sep 21, 2023
8656a40
Refactor component data product code gen
bocchino Sep 21, 2023
b74e95a
Revise component data product code gen
bocchino Sep 21, 2023
e5e86d5
Revise component cpp unit tests
bocchino Sep 21, 2023
9c71506
Revise component cpp unit tests
bocchino Sep 21, 2023
7306732
Revise code gen
bocchino Sep 21, 2023
d6d5ee6
Revise component data product code gen
bocchino Sep 21, 2023
ed5fd56
Revise component data product code gen
bocchino Sep 21, 2023
f2ac75a
Update unit testUpdate unit tests
bocchino Sep 21, 2023
de579e3
Revise component data product code gen
bocchino Sep 21, 2023
f237c89
Update component cpp unit tests
bocchino Sep 21, 2023
697c1dd
Revise component ut tests
bocchino Sep 21, 2023
b9909d9
Revise component impl tests
bocchino Sep 21, 2023
166f28f
Revise component impl tests
bocchino Sep 21, 2023
a9fd1af
Revise component tester base tests
bocchino Sep 21, 2023
a1a3472
Revise unit tests for component tester bases
bocchino Sep 21, 2023
af97d2a
Revise component tester base code gen
bocchino Sep 21, 2023
87b493c
Refactor component tester base code gen
bocchino Sep 21, 2023
6524d5d
Revise component ut impl tests
bocchino Sep 22, 2023
052a341
Revise component ut impl tests
bocchino Sep 22, 2023
883a9bc
Revise component ut impl tests
bocchino Sep 22, 2023
77412d4
Revise component ut code gen
bocchino Sep 25, 2023
c74e325
Revise XML code gen
bocchino Sep 25, 2023
cc65a6c
Revise component dp code gen
bocchino Sep 25, 2023
735e1c6
Revise dp component code gen
bocchino Sep 25, 2023
4cf3b5e
Revise dp code gen tests
bocchino Sep 25, 2023
8cd05c3
Revise component dp code gen
bocchino Sep 26, 2023
ad58cef
Merge branch 'main' into data-products
bocchino Sep 26, 2023
d864f2f
Update DpContainer
bocchino Sep 26, 2023
95ea338
Revise comments in generated code
bocchino Sep 26, 2023
ed24542
Merge branch 'main' into data-products
bocchino Sep 26, 2023
59998e3
Update test output
bocchino Sep 26, 2023
20aa807
Merge branch 'issue-291-component-ut-integration' into data-products-…
bocchino Sep 27, 2023
bac24c4
Update test ref output
bocchino Sep 27, 2023
24d43ce
Update .gitignore
bocchino Sep 28, 2023
89bb322
Merge branch 'issue-330-tool-switches' into data-products-merge-issue…
bocchino Sep 28, 2023
8bef5fd
Reivse check-cpp
bocchino Sep 28, 2023
81838e5
Revise check-cpp
bocchino Sep 28, 2023
20a110a
Revise check-cpp
bocchino Sep 28, 2023
6a7a36c
Revise check-cpp
bocchino Sep 28, 2023
404a507
Add missing files
bocchino Sep 28, 2023
0c3e071
Revise check-cpp
bocchino Sep 28, 2023
deccccc
Revise check-cpp
bocchino Sep 28, 2023
3e28b7a
Merge branch 'issue-330-tool-switches' into data-products-merge-issue…
bocchino Sep 28, 2023
e684a46
Merge branch 'issue-330-tool-switches' into data-products-merge-issue…
bocchino Sep 28, 2023
21c0d4a
Merge branch 'issue-330-tool-switches' into data-products-merge-issue…
bocchino Sep 28, 2023
b500229
Merge branch 'issue-330-tool-switches' into data-products-merge-issue…
bocchino Sep 29, 2023
9fa1fae
Merge branch 'issue-330-tool-switches' into data-products-merge-issue…
bocchino Sep 29, 2023
649c3d5
Merge branch 'issue-330-tool-switches' into data-products-merge-issue…
bocchino Sep 30, 2023
91ac726
Merge branch 'issue-330-tool-switches' into data-products-merge-issue…
bocchino Oct 1, 2023
647c141
Rename Dp_ to dp
bocchino Oct 2, 2023
6cadd53
Revise code gen for dpGet
bocchino Oct 2, 2023
5b27d48
Refactor dp code gen
bocchino Oct 2, 2023
a9dbafa
Revise dp code gen
bocchino Oct 2, 2023
587e837
Revise dp code gen
bocchino Oct 2, 2023
3341311
Revise data product code gen
bocchino Oct 2, 2023
5e35313
Revise data product code gen
bocchino Oct 2, 2023
76c9a1d
Merge branch 'issue-330-tool-switches' into data-products
bocchino Oct 2, 2023
c6fa060
Merge branch 'data-products' into issue-329-dp-request
bocchino Oct 2, 2023
eacb309
Merge branch 'issue-330-tool-switches' into data-products
bocchino Oct 2, 2023
068686f
Regenerate docs
bocchino Oct 2, 2023
0520900
Revise array records in spec
bocchino Oct 2, 2023
10be64c
Revise spec and syntax
bocchino Oct 3, 2023
8bfc952
Merge branch 'main' into data-products
bocchino Oct 3, 2023
b66361f
Merge branch 'data-products' into issue-323-variable-length-arrays
bocchino Oct 3, 2023
b713606
Merge branch 'main' into data-products
bocchino Oct 3, 2023
a4af5f4
Merge branch 'data-products' into issue-323-variable-length-arrays
bocchino Oct 3, 2023
afa18f7
Merge branch 'issue-334-buffer-union-type' into data-products
bocchino Oct 3, 2023
2495b9d
Merge branch 'data-products' into issue-323-variable-length-arrays
bocchino Oct 3, 2023
5b95835
Revise record type syntax
bocchino Oct 3, 2023
a04bc54
Revise syntax; update unit tests
bocchino Oct 3, 2023
3dad423
Revise syntax tests
bocchino Oct 3, 2023
85aab79
Revise fpp-format tests
bocchino Oct 3, 2023
149f9dd
Revise component data product code gen
bocchino Oct 3, 2023
f4ebe13
Update unit tests
bocchino Oct 3, 2023
241fba9
Refactor ast
bocchino Oct 3, 2023
de45f83
Merge branch 'issue-334-buffer-union-type' into data-products
bocchino Oct 3, 2023
b4feb29
Merge branch 'data-products' into issue-323-variable-length-arrays
bocchino Oct 4, 2023
d5f9e13
Revise dp code gen for array records
bocchino Oct 4, 2023
d65e314
Revise component dp code gen
bocchino Oct 4, 2023
996b5c6
Revise component dp code gen
bocchino Oct 5, 2023
f7cecf9
Revise dp code gen unit tests
bocchino Oct 5, 2023
c7c5965
Revise component dp code gen
bocchino Oct 5, 2023
d62eb26
Revise component dp code gen
bocchino Oct 5, 2023
f132db2
Merge branch 'main' into data-products
bocchino Oct 5, 2023
50597e2
Revise dp ut code gen
bocchino Oct 9, 2023
a63f9d5
Revise dp ut code gen
bocchino Oct 9, 2023
9e08101
Revise component ut code gen
bocchino Oct 10, 2023
f9428e6
Fix code formatting
bocchino Oct 10, 2023
59786be
Refactor component ut code gen
bocchino Oct 10, 2023
ba3bc9a
Revise component ut code gen
bocchino Oct 10, 2023
65cec79
Revise component ut code gen
bocchino Oct 10, 2023
8819a1b
Revise component ut code gen
bocchino Oct 10, 2023
bf72e35
Revise component ut code gen
bocchino Oct 10, 2023
30324f3
Revise component ut code gen
bocchino Oct 10, 2023
d8dc315
Revise component ut code gen
bocchino Oct 10, 2023
e460d8f
Revise component ut code gen
bocchino Oct 10, 2023
e1b5d45
Revise component ut code gen
bocchino Oct 11, 2023
5937d97
Revise component ut code gen
bocchino Oct 11, 2023
884fcea
Revise component ut code gen
bocchino Oct 12, 2023
ab822ff
Refactor component dp code gen
bocchino Oct 13, 2023
54ecf5e
Revise component dp code gen
bocchino Oct 13, 2023
0ef255d
Update dp component unit tests
bocchino Oct 13, 2023
24f3385
Revise fpp-to-cpp dp tests
bocchino Oct 13, 2023
9cdf099
Revise fpp-to-cpp component dp tests
bocchino Oct 13, 2023
427dffc
Revise fpp-to-cpp component dp tests
bocchino Oct 13, 2023
8708bd0
Revise component dp code gen
bocchino Oct 13, 2023
281634e
Add missing files
bocchino Oct 13, 2023
4cd1738
Revise fpp-to-cpp dp tests
bocchino Oct 13, 2023
1dfcc72
Revise fpp-to-cpp dp unit tests
bocchino Oct 13, 2023
6a0dccf
Revise fpp-to-cpp dp component tests
bocchino Oct 13, 2023
f65f68f
Revise fpp-to-cpp component dp tests
bocchino Oct 13, 2023
bd8343c
Revise fpp-to-cpp component dp code gen
bocchino Oct 13, 2023
74971f2
Remove trailing space
bocchino Oct 13, 2023
0a4e535
Revise fpp-to-cpp component dp tests
bocchino Oct 13, 2023
f33bb56
Revise fpp-to-cpp component dp tests
bocchino Oct 13, 2023
b7ce91d
Revise fpp-to-cpp component dp tests
bocchino Oct 13, 2023
05226f1
Revise fpp-to-cpp component dp tests
bocchino Oct 13, 2023
7dfe416
Revise fpp-to-cpp component dp code gen
bocchino Oct 13, 2023
98d8fb0
Revise fpp-to-cpp component dp tests
bocchino Oct 13, 2023
5886c61
Revise fpp-to-cpp component dp tests
bocchino Oct 13, 2023
edd7958
Regenerate docs
bocchino Oct 13, 2023
9286063
Revise spec
bocchino Oct 13, 2023
6e80922
Revise semantics
bocchino Oct 13, 2023
935d20d
Revise fpp-check tests
bocchino Oct 13, 2023
46f8473
Remove trailing blank lines
bocchino Oct 13, 2023
2ac2abd
Regenerate docs
bocchino Oct 13, 2023
b728533
Add missing files
bocchino Oct 13, 2023
48ed114
Update trace for native build
bocchino Oct 14, 2023
7c3959a
Update version number
bocchino Oct 16, 2023
281a531
Merge branch 'main' into data-products
bocchino Oct 30, 2023
fef3788
Revise comments in generated code
bocchino Oct 30, 2023
126272a
Revise geneated code for data products
bocchino Oct 30, 2023
af18cc0
Merge branch 'main' into data-products
bocchino Nov 9, 2023
2412fea
Merge branch 'main' into data-products
bocchino Nov 14, 2023
f68a151
Merge branch 'main' into data-products
bocchino Nov 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1,853 changes: 1,703 additions & 150 deletions compiler/lib/src/main/resources/META-INF/native-image/reflect-config.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,18 @@ trait TypeExpressionAnalyzer
}
}

override def specContainerAnnotatedNode(
a: Analysis,
aNode: Ast.Annotated[AstNode[Ast.SpecContainer]]
) = {
val (_, node, _) = aNode
val data = node.data
for {
a <- opt(exprNode)(a, data.id)
a <- opt(exprNode)(a, data.defaultPriority)
} yield a
}

override def specEventAnnotatedNode(a: Analysis, node: Ast.Annotated[AstNode[Ast.SpecEvent]]) = {
val (_, node1, _) = node
val data = node1.data
Expand Down Expand Up @@ -193,10 +205,23 @@ trait TypeExpressionAnalyzer
a <- opt(exprNode)(a, general.size)
a <- opt(exprNode)(a, general.priority)
} yield a
case _ => Right(a)
case special : Ast.SpecPortInstance.Special =>
opt(exprNode)(a, special.priority)
}
}

override def specRecordAnnotatedNode(
a: Analysis,
aNode: Ast.Annotated[AstNode[Ast.SpecRecord]]
) = {
val (_, node, _) = aNode
val data = node.data
for {
a <- typeNameNode(a, data.recordType)
a <- opt(exprNode)(a, data.id)
} yield a
}

override def specTlmChannelAnnotatedNode(a: Analysis, node: Ast.Annotated[AstNode[Ast.SpecTlmChannel]]) = {
def limit(a: Analysis, value: Ast.SpecTlmChannel.Limit) = {
val (_, e) = value
Expand Down
12 changes: 9 additions & 3 deletions compiler/lib/src/main/scala/analysis/Analyzers/UseAnalyzer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ trait UseAnalyzer extends TypeExpressionAnalyzer {
a <- opt(qualIdentNode(portUse))(a, general.port)
a <- opt(exprNode)(a, general.priority)
} yield a
case special : Ast.SpecPortInstance.Special => {
case special : Ast.SpecPortInstance.Special =>
// Construct the use implied by the special port
val name = special.kind match {
case Ast.SpecPortInstance.CommandRecv => "Cmd"
Expand All @@ -102,6 +102,10 @@ trait UseAnalyzer extends TypeExpressionAnalyzer {
case Ast.SpecPortInstance.Event => "Log"
case Ast.SpecPortInstance.ParamGet => "PrmGet"
case Ast.SpecPortInstance.ParamSet => "PrmSet"
case Ast.SpecPortInstance.ProductGet => "DpGet"
case Ast.SpecPortInstance.ProductRecv => "DpResponse"
case Ast.SpecPortInstance.ProductRequest => "DpRequest"
case Ast.SpecPortInstance.ProductSend => "DpSend"
case Ast.SpecPortInstance.Telemetry => "Tlm"
case Ast.SpecPortInstance.TextEvent => "LogText"
case Ast.SpecPortInstance.TimeGet => "Time"
Expand All @@ -110,8 +114,10 @@ trait UseAnalyzer extends TypeExpressionAnalyzer {
val nodeList = identList.map(AstNode.create(_, node.id))
val qualIdent = Ast.QualIdent.fromNodeList(nodeList)
val impliedUse = AstNode.create(qualIdent, node.id)
qualIdentNode(portUse)(a, impliedUse)
}
for {
a <- opt(exprNode)(a, special.priority)
a <- qualIdentNode(portUse)(a, impliedUse)
} yield a
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ object CheckComponentDefs
yield a.copy(component = Some(component))
}

override def specContainerAnnotatedNode(
a: Analysis,
aNode: Ast.Annotated[AstNode[Ast.SpecContainer]]
) = {
val data = aNode._2.data
for {
idOpt <- a.getNonnegativeBigIntValueOpt(data.id)
container <- Container.fromSpecContainer(a, aNode)
component <- a.component.get.addContainer(idOpt, container)
}
yield a.copy(component = Some(component))
}

override def specEventAnnotatedNode(
a: Analysis,
aNode: Ast.Annotated[AstNode[Ast.SpecEvent]]
Expand Down Expand Up @@ -101,6 +114,19 @@ object CheckComponentDefs
Right(a.copy(component = Some(component1)))
}

override def specRecordAnnotatedNode(
a: Analysis,
aNode: Ast.Annotated[AstNode[Ast.SpecRecord]]
) = {
val data = aNode._2.data
val record = Record.fromSpecRecord(a, aNode)
for {
idOpt <- a.getNonnegativeBigIntValueOpt(data.id)
component <- a.component.get.addRecord(idOpt, record)
}
yield a.copy(component = Some(component))
}

override def specTlmChannelAnnotatedNode(
a: Analysis,
aNode: Ast.Annotated[AstNode[Ast.SpecTlmChannel]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ object CheckExprTypes extends UseAnalyzer {

override def exprLiteralIntNode(a: Analysis, node: AstNode[Ast.Expr], e: Ast.ExprLiteralInt) =
Right(a.assignType(node -> Type.Integer))

override def exprLiteralStringNode(a: Analysis, node: AstNode[Ast.Expr], e: Ast.ExprLiteralString) =
Right(a.assignType(node -> Type.String(None)))

Expand All @@ -130,7 +130,7 @@ object CheckExprTypes extends UseAnalyzer {
for {
_ <- Analysis.checkForDuplicateStructMember(getName)(e.members)
a <- super.exprStructNode(a, node, e)
}
}
yield {
def visitor(members: Type.Struct.Members, node: AstNode[Ast.StructMember]): Type.Struct.Members = {
val data = node.data
Expand Down Expand Up @@ -165,6 +165,20 @@ object CheckExprTypes extends UseAnalyzer {
yield a
}

override def specContainerAnnotatedNode(
a: Analysis,
aNode: Ast.Annotated[AstNode[Ast.SpecContainer]]
) = {
val (_, node, _) = aNode
val data = node.data
for {
a <- super.specContainerAnnotatedNode(a, aNode)
_ <- convertNodeToNumericOpt(a, data.id)
_ <- convertNodeToNumericOpt(a, data.defaultPriority)
}
yield a
}

override def specEventAnnotatedNode(a: Analysis, aNode: Ast.Annotated[AstNode[Ast.SpecEvent]]) = {
val (_, node, _) = aNode
val data = node.data
Expand Down Expand Up @@ -226,8 +240,25 @@ object CheckExprTypes extends UseAnalyzer {
_ <- convertNodeToNumericOpt(a, general.priority)
}
yield a
case _ => Right(a)
case special : Ast.SpecPortInstance.Special =>
for {
a <- super.specPortInstanceAnnotatedNode(a, aNode)
_ <- convertNodeToNumericOpt(a, special.priority)
} yield a
}
}

override def specRecordAnnotatedNode(
a: Analysis,
aNode: Ast.Annotated[AstNode[Ast.SpecRecord]]
) = {
val (_, node, _) = aNode
val data = node.data
for {
a <- super.specRecordAnnotatedNode(a, aNode)
_ <- convertNodeToNumericOpt(a, data.id)
}
yield a
}

override def specTlmChannelAnnotatedNode(a: Analysis, aNode: Ast.Annotated[AstNode[Ast.SpecTlmChannel]]) = {
Expand Down Expand Up @@ -281,7 +312,7 @@ object CheckExprTypes extends UseAnalyzer {
// Unqualified constant symbol: visit the constant definition
// to ensure it has a type
case Symbol.Constant(node) => defConstantAnnotatedNode(a, node)
// Unqualified enum symbol: if this is in scope, then we are in
// Unqualified enum symbol: if this is in scope, then we are in
// the enum definition, so it already has a type
case Symbol.EnumConstant(node) => Right(a)
// Invalid use of a symbol in an expression
Expand Down Expand Up @@ -312,7 +343,7 @@ object CheckExprTypes extends UseAnalyzer {
}

private def convertToNumeric(loc: Location, t: Type): Result.Result[Type] = {
if (t.isNumeric) Right(t)
if (t.isNumeric) Right(t)
else if (t.isConvertibleTo(Type.Integer)) Right(Type.Integer)
else {
val error = SemanticError.InvalidType(loc, s"cannot convert $t to a numeric type")
Expand Down
Loading