Skip to content

A tpl pattern language parser for BMC's Atrium Discovery and Dependency Mapping (ADDM).

License

Notifications You must be signed in to change notification settings

codefitz/tplser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tplser

Version

0.1.9 (Beta)

Description

A TPL pattern language parser for BMC's Atrium Discovery and Dependency Mapping (ADDM). Developed with Python 2.6, 2.7

  • PDB debugging is included (off by default) and can be enabled, to run the script normally, press "c" + [Enter] at the (Pdb) prompt.
  • Bugs: Please submit an issue with sample TPL in order to prioritise fix/implementation.

This program is provided under an Apache license and does not contain code from ADDM, the TKU or any other software belonging to BMC or its partners or customers. It works independently of ADDM and is designed for use with TPL pattern language files only.

Usage

To run:

$ python tplser.py file.tpl

Development

Working:

  • IF evaluation parsing
  • FOR loop parsing
  • Summary (counts of statements)
  • Checks for initialised variables
  • Identifies and checks for integrity of section headers (required/missing declarations)
  • Rudimentary file handling
  • Uninitialised variable warnings
  • Trigger syntax
  • If statement handling of else/elif on uninitialised variables
  • ECA error check for concatenation of strings in a log statement
  • Invocations after a stop;
  • Checks for redefined constant variables

Planned:

  • Section headers: simple identities, business application instances
  • Syntax: typo catching
  • table syntax
  • discovery function syntax
  • search syntax
  • CMDB cdm patterns
  • Catching ECA errors (not found by ADDM inbuilt parser)
  • Remove superfluous characters warning
  • Infinite looped assignments e.g.

var := var + something;

  • Can't use """ inside body.
  • Definitions block variables separation into definition name/define name/defined vars

Nice To Have:

  • TPL versioning
  • TPL Best practice suggestions
  • Check imported tpl syntax (external tpl)
  • Handle packages with multiple tpl files
  • GUI
  • Check for node syntax that require an attribute to output

Licensing

Apache 2.0 License - see LICENSE file.

Updates

Release Version Description
Beta 0.1.9 Checking for redefined constants variable assignments.
Open/closing brackets count.
Fixed where undeclared variables getting missed where declared in another pattern.
Alpha 0.1.8 Some more code cleanup and modules added.
Fixed false positive matches where mixed apostrophe/quotes used in line.
Alpha 0.1.7 Moved regexes to compile functions in order to simplify code and eliminate duplication.
Alpha 0.1.6 Bug fixes.
New code to evaluate multiple conditions in trigger statement.
Alpha 0.1.5 Check for syntax that would cause ECA Error - concatenation in a log statement.
Checks for invocations after a stop.
Fixed bug with configuration variable being assigned 0 length string.
Fixed imports not added to variable list.
Alpha 0.1.4 Exported functions to modules.
Corrected variable assignment count summary.
More bugfixes for syntax checking.
Alpha 0.1.3 Added PDB debugging.
Fixed further issues with assigned/uninitialised variables.
Fixed syntax error matching bugs.
Basic string checking added.
Simple Identities count added to summary. Bug fixes.
Parser handles variables declared after an 'else' statement, meaning no warning.
Alpha 0.1.2 Fixed issues with if evaluation blocks - should now be working as expected.
Alpha 0.1.1 Added support for older versions of python for args check.
Improved import parsing code.
Small improvements to syntax checking.
Improved code for uninitialised variable warning.
Added TPL version to summary.
Alpha 0.1.0 Improved matching variables inside brackets.
Fixed parsing of end if; statement where there is whitespace between end if and ;.
Added regex parsing for text functions.
Alpha 0.0.9 Fixed issue where "notes" field on one line throws out section evaluations.
Added syntax check for trigger statement.
Alpha 0.0.8 Fixed imports on multiple lines, improved uninitialised variable matching.
Alpha 0.0.7 Added warnings for uninitialised variables (inside of if block)
Alpha 0.0.6 Added fileInfo, listDirectory, registryKey, definitions to summary.
Now evaluates list of definition variables correctly.
Alpha 0.0.5 Added exception handling for declarations (ignore variables for now).
Added more secion header identification.
Started on syntax recognition for variables.
Alpha 0.0.4 Committed to GitHub.

About

A tpl pattern language parser for BMC's Atrium Discovery and Dependency Mapping (ADDM).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages