Package pspdash

Examples of pspdash.Perl5Util


    private static SaveableData parseFunction
      (String name, String value, DataRepository r, String prefix)
      throws MalformedValueException {

        SaveableData result = null;
        Perl5Util perl = PerlPool.get();
        try {
            String isSimpleFunction = "m\n^" + simpleFunction + "$\n";
            String containsSimpleFunction = "m\n" + simpleFunction + "\n";

            String expression = value.substring(1);    // remove initial "!"
            expression = perl.substitute("s/\\[\\(/" + FB + "/g", expression);
            expression = perl.substitute("s/\\)\\]/" + FE + "/g", expression);

            String pre, func, post, tempname;

            while (! perl.match(isSimpleFunction, expression)) {
                try {
                    if (!perl.match(containsSimpleFunction, expression))
                        throw new MalformedValueException
                            ("mismatched parentheses");
                } catch (Perl5Util.RegexpException e) {
                    throw new MalformedValueException(e.toString());
                }

                pre = perl.preMatch();
                func = perl.group(1);
                post = perl.postMatch();

                tempname = getAnonymousFunctionName();
                //r.makeUniqueName(r.anonymousPrefix + "_Function");
                try {
                    parseSimpleFunc(tempname, func, null, r, prefix);
                } catch (MalformedValueException e) {
                    r.removeValue(tempname);
                    throw e;//new MalformedValueException();
                }
                expression = pre + tempname + post;

            }

            expression = perl.group(1);
            result = parseSimpleFunc(name, expression, value, r, prefix);
        } finally {
            PerlPool.release(perl);
        }
        return result;
View Full Code Here


        String text = asString(getArgOrLocal(arguments, 1, context));
        if (text == null || text.length() == 0)
          return ImmutableDoubleData.FALSE;

        Perl5Util perl = PerlPool.get();
        try {
            if (perl.match(pattern, text))
                return ImmutableDoubleData.TRUE;
            else
                return ImmutableDoubleData.FALSE;

        } catch (Throwable t) {
View Full Code Here

TOP

Related Classes of pspdash.Perl5Util

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.