Skip to content

lharri73/DBC-Language-Syntax

Repository files navigation

DBC Language Syntax

Visual Studio Marketplace Version GitHub Workflow Status

This extension provides basic syntax highlighting, bracket completion, code snippets, lexer/parser errors, and a preview window for the Vector DBC file format. This is created to work with version 2 of the Vector DBC file format.

Although DBC files are often programmatically generated, it can be useful to more easily read the DBC file itself in a plaintext format. Syntax highlighting is handled locally through VSCode's integrated TextMates language parsing engine, using PCRE regular expressions to match syntax.

This extension also provides a sidebar to preview messages in the current, open DBC file. While this doesn't allow editing, it takes information from various parts of the DBC and makes it easily readable and searchable.

The preview window is still a work in progress!

Syntax Highlighting

Message and Signal Preview

Lexicographic and Parser Errors

Commonly Used Snippets

Known Issues

  1. Attribute definitions that wrap lines may not be highlighted on the following lines.
  2. Signals that are multiplexed will not be recognized

Todo items

  • Include debugging (invalid offset, start bit, min, max, etc)
  • Show more information about each signal (val tables, comments, etc.)
  • Show the byte structure of the message

Organization

  • server
    • Contains the language server and parser for the dbc language sytax
  • client
    • Contains the editor and viewer
  • dbcLib
    • basic type descriptions of each element/class of the dbc language

3rd Party Libraries

  • Vector DBC file format.
    • Although no code from this repository is used in this extension, this served as a reference for the DBC format and syntax.
  • jison
    • The parser and lexer used on the server side to parse dbc files
  • React.js
    • Used to display the parsed message/signal data in the vscode browser panel.
  • MessagePack
    • Serializes the parsed DBC file's intermediate representation into a packed binary before sending to the browser panel.

License

GNU General Public License v2.0 only