private List<CmdArg> tokenize()
        throws Exception
    {
        char[] str = value.toCharArray();
        int p = 0;
        List<CmdArg> tokens = new ArrayList<CmdArg>();
        String tok = "";
        boolean invar = false;
        boolean instr = true;
        while (p < str.length) {
            if (invar) {
                if (RuleTreeParser.isAlNumUS(str[p])) {
                    tok += str[p];
                    p++;
                    continue;
                } else {
                    invar = false;
                    instr = true;
                    CmdArg arg = new VarArg(tok);
                    tokens.add(arg);
                    tok = null;
                    continue;
                }
            } else if (instr) {
                if (str[p] != '$') {
                    tok += str[p];
                    p++;
                    continue;
                } else {
                    instr = false;
                    CmdArg arg = new StringArg(tok);
                    tokens.add(arg);
                    tok = null;
                    continue;
                }
            } else if(str[p] == '$') {
                invar = true;
                tok = "$";
                p++;
            }
        }

        if (tok != null) {
            CmdArg arg = null;
            if (instr) {
                arg = new StringArg(tok);
            } else if (invar) {
                arg = new VarArg(tok);
            } else {
                throw new Exception("Unexpected condition/bug");
            }
            tokens.add(arg);
        }
        return tokens;
    }