##// END OF EJS Templates
Refactoring handling of axes properties (1)...
Refactoring handling of axes properties (1) Creates helper used to determine which properties to set for the graph axes, depending on the type of the data hold (properties will be different if it's scalars/vectors or spectrograms)

File last commit:

r2:451739a45362
r916:b92a8e838f6e
Show More
IPSIS_S04_NAMESPACE.tcl
49 lines | 1.3 KiB | application/x-tcl | TclLexer
#!/usr/bin/tclsh
# Naming conventions for namespaces
set namespaceRegex [getParameter "namespace-regex" {^[a-z][a-z1-9]*$}]
proc createMachine {machineName initState} {
set machine [dict create name $machineName state $initState identifier "" bracesCounter 0 bracketCounter 0 angleBracketCounter 0]
return $machine
}
set tokenFilter {
using
namespace
identifier
class
struct
enum
typedef
leftbrace
rightbrace
}
foreach fileName [getSourceFileNames] {
set machines [list]
set lastIdentifier ""
set prev1 ""
set prev2 ""
foreach token [getTokens $fileName 1 0 -1 -1 $tokenFilter] {
set type [lindex $token 3]
set line [lindex $token 1]
# Retrieve identifier value
if {$type == "identifier"} {
set lastIdentifier [lindex $token 0]
}
# Check namespace
if {$prev2 == "namespace" && $prev1 == "identifier" && $type == "leftbrace"} {
if {![regexp $namespaceRegex $lastIdentifier]} {
report $fileName $line "The namespace names should match the following regex: $namespaceRegex (found: $lastIdentifier)"
}
}
set prev2 $prev1
set prev1 $type
}
}