// Path: src/main/java/io/smartcat/ranger/core/ConstantValue.java
// public class ConstantValue<T> extends Value<T> {
// 
//     /**
//      * Constructs constant value which will always return specified <code>value</code>.
//      *
//      * @param value Value to be returned.
//      */
//     public ConstantValue(T value) {
//         this.val = value;
//     }
// 
//     /**
//      * Helper method to construct {@link ConstantValue}.
//      *
//      * @param value Value to be returned by created constant value.
//      * @param <T> Type this value would evaluate to.
//      *
//      * @return An instance of {@link ConstantValue}.
//      */
//     public static <T> ConstantValue<T> of(T value) {
//         return new ConstantValue<T>(value);
//     }
// }
// 
// Path: src/main/java/io/smartcat/ranger/core/ValueProxy.java
// public class ValueProxy<T> extends Value<T> {
// 
//     private Value<T> delegate;
// 
//     /**
//      * Constructs proxy without delegate.
//      */
//     public ValueProxy() {
//     }
// 
//     /**
//      * Constructs proxy with specified <code>delegate</code>.
//      *
//      * @param delegate Value which will be evaluated and cached.
//      */
//     public ValueProxy(Value<T> delegate) {
//         setDelegate(delegate);
//     }
// 
//     /**
//      * Sets value to this proxy.
//      *
//      * @param delegate Value which will be evaluated and cached.
//      */
//     public void setDelegate(Value<T> delegate) {
//         if (delegate == null) {
//             throw new IllegalArgumentException("Delegate cannot be null.");
//         }
//         this.delegate = delegate;
//     }
// 
//     @Override
//     public void reset() {
//         super.reset();
//         checkDelegate();
//         delegate.reset();
//     }
// 
//     @Override
//     protected void eval() {
//         checkDelegate();
//         val = delegate.get();
//     }
// 
//     private void checkDelegate() {
//         if (delegate == null) {
//             throw new DelegateNotSetException();
//         }
//     }
// 
//     /**
//      * Signals that delegate is not set.
//      */
//     public static class DelegateNotSetException extends RuntimeException {
// 
//         private static final long serialVersionUID = 6257779717961934851L;
// 
//         /**
//          * Constructs {@link DelegateNotSetException} with default message.
//          */
//         public DelegateNotSetException() {
//             super("Delegate not set for ValueProxy.");
//         }
//     }
// }


import io.smartcat.ranger.ObjectGenerator;
import io.smartcat.ranger.core.CompositeValue;
import io.smartcat.ranger.core.ConstantValue;
import io.smartcat.ranger.core.TypeConverterValue;
import io.smartcat.ranger.core.Value;
import io.smartcat.ranger.core.ValueProxy;
import org.parboiled.Parboiled;
import org.parboiled.parserunners.ReportingParseRunner;
import org.parboiled.support.ParsingResult;
import java.util.HashMap;
import java.util.Map;
package io.smartcat.ranger.parser;



/**
 * Constructs {@link ObjectGenerator} out of parsed configuration.
 */
public class ConfigurationParser {

    private static final String VALUES = "values";
    private static final String OUTPUT = "output";

    private final Map<String, Object> values;
    private final Object outputExpression;
// Path: src/main/java/io/smartcat/ranger/core/ConstantValue.java
// public class ConstantValue<T> extends Value<T> {
// 
//     /**
//      * Constructs constant value which will always return specified <code>value</code>.
//      *
//      * @param value Value to be returned.
//      */
//     public ConstantValue(T value) {
//         this.val = value;
//     }
// 
//     /**
//      * Helper method to construct {@link ConstantValue}.
//      *
//      * @param value Value to be returned by created constant value.
//      * @param <T> Type this value would evaluate to.
//      *
//      * @return An instance of {@link ConstantValue}.
//      */
//     public static <T> ConstantValue<T> of(T value) {
//         return new ConstantValue<T>(value);
//     }
// }
// 
// Path: src/main/java/io/smartcat/ranger/core/ValueProxy.java
// public class ValueProxy<T> extends Value<T> {
// 
//     private Value<T> delegate;
// 
//     /**
//      * Constructs proxy without delegate.
//      */
//     public ValueProxy() {
//     }
// 
//     /**
//      * Constructs proxy with specified <code>delegate</code>.
//      *
//      * @param delegate Value which will be evaluated and cached.
//      */
//     public ValueProxy(Value<T> delegate) {
//         setDelegate(delegate);
//     }
// 
//     /**
//      * Sets value to this proxy.
//      *
//      * @param delegate Value which will be evaluated and cached.
//      */
//     public void setDelegate(Value<T> delegate) {
//         if (delegate == null) {
//             throw new IllegalArgumentException("Delegate cannot be null.");
//         }
//         this.delegate = delegate;
//     }
// 
//     @Override
//     public void reset() {
//         super.reset();
//         checkDelegate();
//         delegate.reset();
//     }
// 
//     @Override
//     protected void eval() {
//         checkDelegate();
//         val = delegate.get();
//     }
// 
//     private void checkDelegate() {
//         if (delegate == null) {
//             throw new DelegateNotSetException();
//         }
//     }
// 
//     /**
//      * Signals that delegate is not set.
//      */
//     public static class DelegateNotSetException extends RuntimeException {
// 
//         private static final long serialVersionUID = 6257779717961934851L;
// 
//         /**
//          * Constructs {@link DelegateNotSetException} with default message.
//          */
//         public DelegateNotSetException() {
//             super("Delegate not set for ValueProxy.");
//         }
//     }
// }


// Path: src/main/java/io/smartcat/ranger/parser/ConfigurationParser.java
import io.smartcat.ranger.ObjectGenerator;
import io.smartcat.ranger.core.CompositeValue;
import io.smartcat.ranger.core.ConstantValue;
import io.smartcat.ranger.core.TypeConverterValue;
import io.smartcat.ranger.core.Value;
import io.smartcat.ranger.core.ValueProxy;
import org.parboiled.Parboiled;
import org.parboiled.parserunners.ReportingParseRunner;
import org.parboiled.support.ParsingResult;
import java.util.HashMap;
import java.util.Map;

package io.smartcat.ranger.parser;



/**
 * Constructs {@link ObjectGenerator} out of parsed configuration.
 */
public class ConfigurationParser {

    private static final String VALUES = "values";
    private static final String OUTPUT = "output";

    private final Map<String, Object> values;
    private final Object outputExpression;
    private Map<String, ValueProxy<?>> proxyValues;