What is PSL
PSL is both an interpreted and a compiled language for writing complex application discovery procedures, parameters, and commands within the PATROL environment. It is also a good language for writing arbitrary commands and tasks.
PSL has been designed to provide functions needed to efficiently develop KMs for the PATROL environment. To accomplish this, PSL sacrifices some of the completeness of languages such as C, csh, Perl, or awk ,
while implementing some of the statements and functions that make those languages so powerful and popular. Users familiar with one of those languages should have little difficulty in adapting to PSL. The following section describes some important features of PSL.
Interpreted PSL Scripts
Upon receiving a script, PSL compiles the whole script into an internal form. If the script is syntactically correct, the internal form is then interpreted. Upon re-execution, the script is not recompiled.
Compiled PSL Binary Files
PSL includes a standalone compiler to compile PSL scripts and create executable PSL binaries outside the PATROL Agent. There is also an external interpreter that simulates all aspects of PSL execution except those areas specific to the PATROL Agent. For more information on compiling PSL scripts, see %RESET--Clear Error Counters.
Optimization
Like C, PSL evaluates expressions at compile time, and determines that all of the arguments used with an operator are static and have no unexpected effects.
String literals are concatenated at compile time, and backslashes are interpreted at compile time. For example, the following expression is reduced to one string internally at compile time:
“Now is the time for all” .“\n” .
“good men to come to.”
PSL is also highly efficient. The language is not immediately interpreted, but is compiled into an internal form that is then executed by a high-speed interpreter.
Diagnostics
If any compilation errors are encountered when a PSL script is compiled, error messages display the line number of the error and briefly describe the cause of the error. For more information about compiling and executing PSL programs, see PSL External Commands
Comments
Log in or register to comment.