Giter Club home page Giter Club logo

candies's Introduction

๐Ÿฌ ๐Ÿฌ candies ๐Ÿฌ ๐Ÿฌ

An attempt to write an understandable, extensible, composable CAN DBC parser in Scala

Input:

BA_ "GenMsgCycleTime" BO_ 1 33;

BO_ 0 MSG1: 8 Vector__XXX
 SG_ Mux1 M : 39|4@0+ (1,0) [0|0] "" Vector__XXX
 SG_ Reg1 : 16|4@1- (1,0) [0|0] "" Vector__XXX
 SG_ Mex0 m0 : 7|16@0- (0.1,-40) [0|0] "degC" Vector__XXX
 SG_ Mex3 m3 : 7|16@0- (0.1,-40) [0|0] "degC" Vector__XXX
 SG_ Mex11 m11 : 7|16@0- (0.1,-40) [0|0] "degC" Vector__XXX

BA_ "GenMsgCycleTime" BO_ 0 25;

BO_ 1 MSG2: 8 Vector__XXX
 SG_ Mux1 M : 39|4@0+ (1,0) [0|0] "" Vector__XXX
 SG_ Reg1 : 16|4@1- (1,0) [0|0] "" Vector__XXX
 SG_ Mex0 m0 : 7|16@0- (0.1,-40) [0|0] "degC" Vector__XXX
 SG_ Mex3 m3 : 7|16@0- (0.1,-40) [0|0] "degC" Vector__XXX
 SG_ Mex11 m11 : 7|16@0- (0.1,-40) [0|0] "degC" Vector__XXX

Output:

Network(
  List(
    Message(
      0,
      MSG1,
      8,
      Vector__XXX,
      List(
        Signal(
          Reg1,
          Regular,
          16,
          4,
          Signed,
          Big,
          1.0,
          0.0,
          0.0,
          0.0,
          ,
          25 milliseconds,
          List(
            Vector__XXX
          )
        )
      ),
      Some(
        Multiplex(
          Signal(
            Mux1,
            Multiplexer,
            39,
            4,
            Unsigned,
            Little,
            1.0,
            0.0,
            0.0,
            0.0,
            ,
            25 milliseconds,
            List(
              Vector__XXX
            )
          ),
          Map(
            11 -> MuxGroup(
              11,
              List(
                Signal(
                  Mex11,
                  Multiplexed(11),
                  7,
                  16,
                  Signed,
                  Little,
                  0.1,
                  -40.0,
                  0.0,
                  0.0,
                  degC,
                  25 milliseconds,
                  List(
                    Vector__XXX
                  )
                )
              )
            ),
            3 -> MuxGroup(
              3,
              List(
                Signal(
                  Mex3,
                  Multiplexed(3),
                  7,
                  16,
                  Signed,
                  Little,
                  0.1,
                  -40.0,
                  0.0,
                  0.0,
                  degC,
                  25 milliseconds,
                  List(
                    Vector__XXX
                  )
                )
              )
            ),
            0 -> MuxGroup(
              0,
              List(
                Signal(
                  Mex0,
                  Multiplexed(0),
                  7,
                  16,
                  Signed,
                  Little,
                  0.1,
                  -40.0,
                  0.0,
                  0.0,
                  degC,
                  25 milliseconds,
                  List(
                    Vector__XXX
                  )
                )
              )
            )
          )
        )
      )
    ),
    Message(
      1,
      MSG2,
      8,
      Vector__XXX,
      List(
        Signal(
          Reg1,
          Regular,
          16,
          4,
          Signed,
          Big,
          1.0,
          0.0,
          0.0,
          0.0,
          ,
          33 milliseconds,
          List(
            Vector__XXX
          )
        )
      ),
      Some(
        Multiplex(
          Signal(
            Mux1,
            Multiplexer,
            39,
            4,
            Unsigned,
            Little,
            1.0,
            0.0,
            0.0,
            0.0,
            ,
            33 milliseconds,
            List(
              Vector__XXX
            )
          ),
          Map(
            11 -> MuxGroup(
              11,
              List(
                Signal(
                  Mex11,
                  Multiplexed(11),
                  7,
                  16,
                  Signed,
                  Little,
                  0.1,
                  -40.0,
                  0.0,
                  0.0,
                  degC,
                  33 milliseconds,
                  List(
                    Vector__XXX
                  )
                )
              )
            ),
            3 -> MuxGroup(
              3,
              List(
                Signal(
                  Mex3,
                  Multiplexed(3),
                  7,
                  16,
                  Signed,
                  Little,
                  0.1,
                  -40.0,
                  0.0,
                  0.0,
                  degC,
                  33 milliseconds,
                  List(
                    Vector__XXX
                  )
                )
              )
            ),
            0 -> MuxGroup(
              0,
              List(
                Signal(
                  Mex0,
                  Multiplexed(0),
                  7,
                  16,
                  Signed,
                  Little,
                  0.1,
                  -40.0,
                  0.0,
                  0.0,
                  degC,
                  33 milliseconds,
                  List(
                    Vector__XXX
                  )
                )
              )
            )
          )
        )
      )
    )
  )
)

candies's People

Contributors

ioreskovic avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.