Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lcaballero/messageio
Small Antlr parser for small Sql DTO IDL.
https://github.com/lcaballero/messageio
Last synced: 23 days ago
JSON representation
Small Antlr parser for small Sql DTO IDL.
- Host: GitHub
- URL: https://github.com/lcaballero/messageio
- Owner: lcaballero
- Created: 2013-02-20T15:37:15.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-02-27T07:44:15.000Z (almost 12 years ago)
- Last Synced: 2024-04-14T19:27:33.609Z (9 months ago)
- Language: Java
- Size: 3.03 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MessageIO
This is a java library that can map a file in of Message.g4 grammar to different target
code files. The idea is that the target(s) may grow in number but they would all hold
to the interface published the mapping file.## Example
Given a file like the one below it might produce a C# file matching the code that follows
the example.```CSharp
version 1.0.0[Inputs]
[UserInfoService]
message UserProfileInputs {
[Primary] int Id;
string FirstName;
string LastName;
}[Outputs]
[UserInfoService]
message UserProfileOutputs {
[Primary] int? Id;
string FirstName;
string LastName;
int? AddressId;
DateTime? DateOfBirth;
}
``````CSharp
// Version: 1.0.0
// Service Call:
// Application:
// Port:namespace LucidEdge.SqlRequests
{
// [Inputs]
// [UserInfoService]
public class Inputs : IParameterBuilder
{
// [Primary]
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }public new List ToParameters()
{
return
new List
{
new DataPoint("Id", Id),
new DataPoint("FirstName", FirstName),
new DataPoint("LastName", LastName)
};
}
}
// [Outputs]
// [UserInfoService]
public class Inputs : IParameterBuilder
{
// [Primary]
public int? Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public int? AddressId { get; set; }
public DateTime? DateOfBirth { get; set; }public new List ToParameters()
{
return
new List
{
new DataPoint("Id", Id),
new DataPoint("FirstName", FirstName),
new DataPoint("LastName", LastName),
new DataPoint("AddressId", AddressId),
new DataPoint("DateOfBirth", DateOfBirth)
};
}
}}
``````SQL
-- Version: 1.0.0
-- Service Call:
-- Application:
-- Port:CREATE TABLE (
Id int,
FirstName string,
LastName string
);
CREATE TABLE (
Id int?,
FirstName string,
LastName string,
AddressId int?,
DateOfBirth DateTime?
);
```# TODO
1. Updated the project name to use ServiceIO instead of MessageIO
1. Change the java namespace.
1. Change the .bat paths.
1. Change the file extension.
1. Change the syntax highlighting extensions.
1. Create a template that will transform the Service file into a table creation sql script. Possibly also an insert row .sql script as well.# DONE
1. [DONE] Change the attribute syntax to [Attr] and not [Attr1,Attr2] just incase
a future version might better use [Attr(p=v)].# Licesnse
LucidEdge.MessageIO and LucidEdge.Service are release under the MIT License.
Copyright 2013
Read the license here: http://opensource.org/license/MIT
Date: 2013-02-17