Skip to content
Ivan Kochurkin edited this page Aug 9, 2018 · 6 revisions

PT.PM (PT Pattern Matching Engine)

Documentation

Articles

Projects Description

  • Creating an AST from the source code and converting this parse tree to UST (C#, Java, PHP, PL/SQL, T-SQL, and JavaScript are implemented).
  • PT.PM.CSharpParseTreeUst for C#- and ASP.NET files (.aspx, .ascx, etc.).
    • PT.PM.JavaParseTreeUst
    • PT.PM.PhpParseTreeUst
    • PT.PM.SqlParseTreeUst (for PL/SQL and T-SQL)
    • PT.PM.JavaScriptParseTreeUst
  • DSL processing:
    • PT.PM.Patterns
    • PT.PM.Dsl
  • UST preprocessing:
    • PT.PM.UstPreprocessing
  • Patterns and UST matching:
    • PT.PM.Patterns
    • PT.PM.Matching

Other projects:

  • PT.PM.Common is a helper shared library.
  • PT.PM.AntlrUtils are the helper methods for working with ANTLR grammars.
  • PT.PM is a common workflow (combining work steps, their timing).
  • PT.PM.Cli is used for interaction with a console. Also, it contains an implementation of loggers.
  • PT.PM.Prebuild is a utility for creating parsers from ANTLR grammars that takes into consideration the changes in the grammars files.
  • PT.PM.PatternEditor is an editor for creating and checking the user patterns. This GUI can be used to check the correctness of grammars and parsing algorithms, convert and match a UST.

Unit tests for projects are located in the projects with similar names containing the .Tests suffix:

  • PT.PM.CSharpParseTreeUst.Tests
  • PT.PM.CSharpAntlrParseTreeUst.Tests
  • PT.PM.JavaParseTreeUst.Tests
  • PT.PM.PhpParseTreeUst.Tests
  • PT.PM.SqlParseTreeUst.Tests
  • PT.PM.JavaScriptParseTreeUst.Tests
  • PT.PM.Dsl.Tests
  • PT.PM.UstPreprocessing.Tests
  • PT.PM.Matching.Tests
  • PT.PM.Tests
  • PT.PM.Cli.Tests

Parsing and converting test scenarios are written for projects downloaded from GitHub and cached in a local folder.

Dependencies

  • CommandLineParser is used for parsing command-line arguments.
  • Microsoft.CodeAnalysis (Roslyn) is used for analyzing and parsing .NET-based languages (C#).
  • ANTLR is used for parsing formal languages (Java, PHP, PL/SQL, T-SQL, JavaScript, and DSL).
  • Newtonsoft.Json is used for serialization/deserialization of JSON.
  • NLog is a logging system.
  • NUnit is a framework for working with unit tests.
  • Avalonia is a cross-platform .XAML-based NET UI framework.
  • Graphviz is used for drawing tree structures and graphs.