0.2.0 (Beta)
A TPL pattern language parser and lightweight IDE for BMC's Discovery (formerly ADDM). Compatibile with Python 2.7-3.6.
- 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.
To run the parser:
$ py tplser.py file.tpl
To run the basic editor:
Open tplser.html in a modern html5 browser.
- 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
- 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
- TPL versioning
- TPL Best practice suggestions
- Check imported tpl syntax (external tpl)
- Handle packages with multiple tpl files
- Check for node syntax that require an attribute to output
- For loop inside of of an if/else will throw up undeclared variable error.
Apache 2.0 License - see LICENSE file.
Release | Version | Description |
---|---|---|
Beta | 0.2.0 | Some bug fixes and code refactoring for Python 3.6. Made stats a seperate script. |
Beta | 0.2.0 | Added lightweight html web interface - no saving or syntax highlighting at current, no parser integration. |
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. |