Examples of Parser


Examples of jmt.engine.math.parser.Parser

   * @param meanExpression expression to be evaluated to find mean value
   */
  public synchronized void setRangeDistributionMean(Object key, String meanExpression) {
    Range tmp = ranges.get(key);
    // Calculates min value using parser and sets it into distribution
    Parser parser = new Parser(meanExpression, true);

    try {
      parser.setVariable(VAR, tmp.from);
      tmp.distribution.setMean(parser.getValue());
      // Allow range only if its value in 'from' point is assignable to
      // current distribution
      if (tmp.distribution.getMean() - parser.getValue() < 1e-5) {
        tmp.meanExpression = parser.getExpression();
      }
    } catch (ParseError e) {
      // Do nothing
    } catch (EvaluationException e) {
      // Do nothing
View Full Code Here

Examples of lipstone.joshua.parser.Parser

import testHarnesses.originalGUI.ParserGUI;

public class testParser {
 
  public static void main(String[] args) {
    final Parser parser = new Parser();
    PluginController pc = new PluginController(parser);
    pc.setAutomaticStackPrinting(true);
    final JFrame frame = new JFrame("Equation Parser");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.add(new ParserGUI(parser));
View Full Code Here

Examples of macromedia.asc.parser.Parser

        return null;
      }     
    });
    ((ContextStatics) perCompileData).handler = context.getHandler();

    Parser parser = new Parser(context, stringBuffer.toString(), file.getName());
    MetaDataNode metaDataNode = parser.parseMetaData();
    macromedia.asc.parser.MetaDataEvaluator metaDataEvaluator = new macromedia.asc.parser.MetaDataEvaluator();
    metaDataNode.evaluate(context, metaDataEvaluator);

    return context.errorCount() > 0 ? null : new MetaData(metaDataNode);
  }
View Full Code Here

Examples of mesquite.lib.Parser

      // taxa.getTaxon(it).setNameIsDefault(true);
    }

    // need to make sure newick string consists of indices:
    StringBuffer newick = new StringBuffer();
    Parser mesqParser = new Parser(pNewick);
    String aToken = mesqParser.getNextToken();
    int i = 0;
    while (!TreebaseUtil.isEmpty(aToken)) {
      // logger.debug(" " + i+ ": " + aToken);
      String aTokenwithUnderline = StringUtil.blanksToUnderline(aToken);
      if (taxonLabelStrToIndexMap.containsKey(aTokenwithUnderline)) {
        newick.append(taxonLabelStrToIndexMap.get(aTokenwithUnderline).toString());
      } else {
        newick.append(aToken);
      }
      i++;
      aToken = mesqParser.getNextToken();
    }

    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("replace newick=" + newick); //$NON-NLS-1$
    }
View Full Code Here

Examples of net.janino.Parser

  // require Janino from http://www.janino.net
  private static class JaninoCompiller implements Compiller {

    public byte[] compile( String name, String source) throws Exception {
      // using janino embeddable compiller
      Parser p = new Parser( new Scanner( name, new StringReader( source)));
      CompilationUnit cu = p.parseCompilationUnit();
      IClassLoader cl = new ClassLoaderIClassLoader( new URLClassLoader( new URL[] {}));
      return cu.compile( cl, 0)[0].toByteArray();
    }
View Full Code Here

Examples of net.mitza.odata.parser.Parser

    Criteria result = new AndCriteria(criterias.toArray(new Criteria[0]));
    return result;
  }

  private Criteria buildFromFilter() {
    Parser criteriaParser = new Parser();
    Expression expression = criteriaParser.parse(filter);
    return expression.getCritera();
  }
View Full Code Here

Examples of net.mitza.rel.parser.Parser

  public Object evaluate(String expression) {
    if (expression == null) {
      return "";
    }

    Parser parser = new Parser(context);
    ExpressionNode expressionNode = parser.parseExpression(expression);
    return expressionNode.getValue();
  }
View Full Code Here

Examples of net.nutch.parse.Parser

  public void testId3v2() throws ProtocolException, ParseException {

    String urlString;
    Protocol protocol;
    Content content;
    Parser parser;
    Parse parse;

    urlString = "file:" + sampleDir + fileSeparator + id3v2;
    protocol = ProtocolFactory.getProtocol(urlString);
    content = protocol.getContent(urlString);

    parser = ParserFactory.getParser(content.getContentType(), urlString);
    parse = parser.getParse(content);
    Properties metadata = parse.getData().getMetadata();
    assertEquals("postgresql comment id3v2", metadata.getProperty("COMM-Text"));
    assertEquals("postgresql composer id3v2", metadata.getProperty("TCOM-Text"));
    assertEquals("02", metadata.getProperty("TRCK-Text"));
    assertEquals("http://localhost/", metadata.getProperty("WCOP-URL Link"));
View Full Code Here

Examples of net.percederberg.grammatica.parser.Parser

     *             initialized correctly
     */
    public Parser createParser(Tokenizer tokenizer, Analyzer analyzer)
        throws GrammarException {

        Parser  parser;

        try {
            parser = new RecursiveDescentParser(tokenizer, analyzer);
            for (int i = 0; i < productions.size(); i++) {
                parser.addPattern((ProductionPattern) productions.get(i));
            }
            parser.prepare();
        } catch (ParserCreationException e) {
            LineRange range = (LineRange) lines.get(e.getName());
            if (range == null) {
                throw new GrammarException(fileName, e.getMessage());
            } else {
View Full Code Here

Examples of net.rootdev.javardfa.Parser

      throw new RuntimeException(e);
    }
  }

  private void parse(MGraph target, InputSource in, UriRef baseURI) throws IOException {
    Parser parser = new Parser(new ClerezzaStatementSink(target));
    if (baseURI != null) {
      parser.setBase(baseURI.getUnicodeString());
    } else {
      parser.setBase("urn:x-relative:root");
    }
    initParser(parser);
    try {
      XMLReader xreader = getReader();
      xreader.setContentHandler(parser);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.