Closed SLabuz95 closed 2 years ago
In this review, all procedures, which are called by events related to state events. State events are generated by detection of keywords.
All changes are based on concepts and terminologies from following documentation referance: Summary of Tcl language syntax. All states and way of processing Tcl scripts shall be changed based on informations from above documentation reference.
Tcl Interpreter Stats can be described with the following attributes:
All stats which are not similar to CommandSubbing (stats which do not perform any operation on ProcedureCalls, arguments control, etc.) shall be specified before CommandSubbing enum value (value less then CommandSubbing). All stats related to CommandSubbing (stats which perform any operation on ProcedureCalls, arguments control, etc.) shall be specified after CommandSubbing.
DoubleQuotes is interpreted as Braces until VariableSubbing or CommandSubbing occurs. If so, new ProcedureCall is created with defined for DoubleQuotes stat rules. Additionally,if last parameter of ProcedureCall is Word,then ,for every word or stat interpreted as word, last parameter shall be appended.
In all processing methods (Interpret methods) shall perform filtering of stats. If stat value is greater or equal then CommandSubbing value, then return CommandSubbing value.
Attributes:
Tcl Interpreter stat Word replaced old stat UnknownString. To process all to characters, which dont contain keywords (strings which have been ignored while keywords detection (between keywords/events)).
Attributes:
Tcl Interpreter stat VariableSubbing replaced old stat Variable. Contains reference (by name) to variable, which has been written after VariableSubstitution sign $.
Attributes:
Tcl Interpreter stat CommandSubbing replaced old stat FunctionCall. Contains information about processing of Command Call.
For any keyword "::", throw an error.
Check whitespace occurance by method, not by variable. Update whitespaceOccurance flag only in callInterpretFunction method with checkWhitespace method.
Algorithm
graph TD
WhitespaceResult[/"whitespace = (stat of lastSavedStat == Stat::Whitespace)"/] -->CheckWhitespace
CheckWhitespace{whitespace} --True--> removeLastSavedStatError[/"return result of removeLastSavedStat()"/]
CheckWhitespace --False--> returnNoError["return Error::NoError"]
CallInterpretFunction shall check whitespace occurance. CallInterpretFunction shall take 1 default argument (Stat = Stat::Size). If Stat is not Stat::Size (not default), then add to Stat to processingStats.
Algorithm
graph TD
CheckWhitespace["checkWhitespace()"] --> statCheck{stat != Stat::Size}
statCheck --True--> addProcessingStat["append processingStats with stat"]
addProcessingStat --> callInterpretFunction["call interpret function for last processing stat"]
statCheck --False--> callInterpretFunction
In processUnknownString method, call method callInterpretFunction with argument Stat::Word.
In initialization, read UnknownString value. Dont use SavedStat.
FunctionReady flag should not used in SavedStat, cause this flag relates to FunctionCalls, not to SavedStat. FunctionReady probably will not be used in new implemantation of TclInterpreterEngine.
Generated data can be used for any type of file, not only CAPL scripts.
Tcl Interpreter Engine Review should verify contradictions between Tcl Interpreter Engine devoloped for TclToTextFileGenerator and original Tcl language by code analysis. Redesign will change how the engine works. All contradictions should be written down and fixed.