Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LabComm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sven Gestegård Robertz
LabComm
Commits
cd7ccf44
Commit
cd7ccf44
authored
13 years ago
by
Sven Robertz
Browse files
Options
Downloads
Patches
Plain Diff
small changes
parent
c11dc39c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/simple_java/README
+3
-0
3 additions, 0 deletions
examples/simple_java/README
examples/simple_java/example_encoder.c
+2
-0
2 additions, 0 deletions
examples/simple_java/example_encoder.c
examples/simple_java/run.sh
+2
-1
2 additions, 1 deletion
examples/simple_java/run.sh
with
7 additions
and
1 deletion
examples/simple_java/README
+
3
−
0
View file @
cd7ccf44
NB! Before trying to build and run this example, make sure you have built the LabComm compiler
by running "ant jar" in the main directory (../../ seen from here).
This is a very simple example with one labcomm file (simple.lc) defining two samples.
This is a very simple example with one labcomm file (simple.lc) defining two samples.
Example source code: Encoders and decoders written in Java and C.
Example source code: Encoders and decoders written in Java and C.
Encoder.java
Encoder.java
...
...
This diff is collapsed.
Click to expand it.
examples/simple_java/example_encoder.c
+
2
−
0
View file @
cd7ccf44
...
@@ -18,10 +18,12 @@ int main(int argc, char *argv[]) {
...
@@ -18,10 +18,12 @@ int main(int argc, char *argv[]) {
simple_IntString
is
;
simple_IntString
is
;
is
.
x
=
24
;
is
.
x
=
24
;
is
.
s
=
"Hello, LabComm!"
;
is
.
s
=
"Hello, LabComm!"
;
printf
(
"Encoding IntString, x=%d, s=%s
\n
"
,
is
.
x
,
is
.
s
);
labcomm_encode_simple_IntString
(
encoder
,
&
is
);
labcomm_encode_simple_IntString
(
encoder
,
&
is
);
simple_TwoInts
ti
;
simple_TwoInts
ti
;
ti
.
a
=
13
;
ti
.
a
=
13
;
ti
.
b
=
37
;
ti
.
b
=
37
;
printf
(
"Encoding TwoInts, a=%d, b=%d
\n
"
,
ti
.
a
,
ti
.
b
);
labcomm_encode_simple_TwoInts
(
encoder
,
&
ti
);
labcomm_encode_simple_TwoInts
(
encoder
,
&
ti
);
}
}
This diff is collapsed.
Click to expand it.
examples/simple_java/run.sh
+
2
−
1
View file @
cd7ccf44
java
-cp
.:../../lib/java:gen Encoder encoded_data
java
-cp
.:../../lib/java:gen Encoder encoded_data
java
-cp
.:../../lib/java:gen Decoder encoded_data
./example_decoder encoded_data
./example_decoder encoded_data
./example_encoder encoded_data
java
-cp
.:../../lib/java:gen Decoder encoded_data
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment