This folder contains all of the files necessary for your extension.
package.json - this is the manifest file in which you declare your language support and define the location of the grammar file that has been copied into your extension.
syntaxes/p4.tmLanguage.json - this is the Text mate grammar file that is used for tokenization.
language-configuration.json - this is the language configuration, defining the tokens that are used for comments and brackets.
src/main.ts - contains all visitors for semantic highlight
src/grammar/* - contains all P4 language grammar specification (with a bit modification).
Known Issues and TODO List
Syntax
I only deal with some simple things in syntax, which means, without a semantic highlight, this extension might be a bit useless.
Semantic
TODO: provide a TypeDefinitionProvider
TODO: deal with macros. For now I just skip all macro lines. But when it comes to #ifdef, #else sequences, something could go wrong.