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

Update Java code-generation runtime to support VDMUtil`seq_of_char2val #697

Closed
peterwvj opened this issue Mar 22, 2019 · 1 comment
Closed
Assignees
Labels
enhancement Not a bug, but nice to have
Milestone

Comments

@peterwvj
Copy link
Member

We need limited Java code-generation support for VDMUtil`seq_of_char2val. Specifically, this function should support nat, nat1, int, rat, real, bool, char and quotes as well as unions of these types.

@peterwvj peterwvj added the enhancement Not a bug, but nice to have label Mar 22, 2019
@peterwvj peterwvj added this to the v2.6.6 milestone Mar 22, 2019
@peterwvj peterwvj self-assigned this Mar 22, 2019
@peterwvj
Copy link
Member Author

peterwvj commented Mar 22, 2019

Example cases that the Java code-generator supports are shown below:

class Entry

operations

public static Run : () ==> ?
Run () ==
return [VDMUtil`seq_of_char2val[nat]("0"),
  VDMUtil`seq_of_char2val[nat]("-1"),
  VDMUtil`seq_of_char2val[nat1]("42"),
  VDMUtil`seq_of_char2val[nat1]("0"),
  VDMUtil`seq_of_char2val[int]("-4"),
  VDMUtil`seq_of_char2val[int]("2.5"),
  VDMUtil`seq_of_char2val[rat]("-3.5"),
  VDMUtil`seq_of_char2val[rat]("true"),
  VDMUtil`seq_of_char2val[real]("1.2345"),
  VDMUtil`seq_of_char2val[real]("nil"),
  VDMUtil`seq_of_char2val[bool]("true"),
  VDMUtil`seq_of_char2val[bool]("nil"),
  VDMUtil`seq_of_char2val[char]("'x'"),
  VDMUtil`seq_of_char2val[char]("'xx'"),
  VDMUtil`seq_of_char2val[<A>]("<A>"),
  VDMUtil`seq_of_char2val[<B>]("<A>"),
  VDMUtil`seq_of_char2val[<A> | <B>]("<A>"),
  VDMUtil`seq_of_char2val[<A> | <B>]("<B>"),
  VDMUtil`seq_of_char2val[<A> | <B>]("<C>"),
  VDMUtil`seq_of_char2val[bool | nat]("true"),
  VDMUtil`seq_of_char2val[bool | nat]("55"),
  VDMUtil`seq_of_char2val[bool | nat]("2.5"),
  VDMUtil`seq_of_char2val[bool | nat]("nil")]

end Entry

class VDMUtil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Not a bug, but nice to have
Projects
None yet
Development

No branches or pull requests

1 participant