Home | History | Annotate | Download | only in parser
      1 /*******************************************************************************
      2  * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
      3  * All rights reserved. This program and the accompanying materials
      4  * are made available under the terms of the Eclipse Public License v1.0
      5  * which accompanies this distribution, and is available at
      6  * http://www.eclipse.org/legal/epl-v10.html
      7  *
      8  * Contributors:
      9  *    Marc R. Hoffmann - initial API and implementation
     10  *
     11  *******************************************************************************/
     12 package org.jacoco.examples.parser;
     13 
     14 import java.io.IOException;
     15 
     16 public class Main {
     17 
     18 	public static void main(final String[] args) throws IOException {
     19 		for (String expression : args) {
     20 			ExpressionParser parser = new ExpressionParser(expression);
     21 			double result = parser.parse().evaluate();
     22 			System.out.printf("%s = %s%n", expression, result);
     23 		}
     24 	}
     25 
     26 }
     27