/**
 * Copyright (c) 2011 committers of YAKINDU and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     committers of YAKINDU - initial API and implementation
 */
grammar org.yakindu.sct.generator.genmodel.SGen with org.eclipse.xtext.common.Terminals

import "http://www.eclipse.org/emf/2002/Ecore" as ecore
import "platform:/resource/org.yakindu.sct.model.sgen/model/emf/sgen.ecore" as gen
import "platform:/resource/org.yakindu.sct.model.sgraph/model/emf/sgraph.ecore" as sct

/**
 * @author Andreas Muelder
 */
GeneratorModel returns gen::GeneratorModel:
	'GeneratorModel' 'for' generatorId=QID '{'
	(entries+=GeneratorEntry)*
	'}';
 
GeneratorEntry returns gen::GeneratorEntry:
	contentType=ID elementRef=[ecore::EObject|QID] '{'
	(features+=FeatureConfiguration)*
	'}';
 
FeatureConfiguration returns gen::FeatureConfiguration:
	{gen::FeatureConfiguration} 'feature' type=[gen::FeatureType] '{'
	(parameterValues+=FeatureParameterValue)*
	'}';

FeatureParameterValue returns gen::FeatureParameterValue:
	{gen::FeatureParameterValue} parameter=[gen::FeatureParameter] '=' expression=Literal;

Literal returns gen::Literal:
	BoolLiteral | IntLiteral | RealLiteral | StringLiteral;

BoolLiteral returns gen::BoolLiteral:
	{gen::BoolLiteral} value=BOOL;

IntLiteral returns gen::IntLiteral:
	{gen::IntLiteral} value=INT;

RealLiteral returns gen::RealLiteral:
	{gen::RealLiteral} value=FLOAT;

StringLiteral returns gen::StringLiteral:
	{gen::StringLiteral} value=STRING;

terminal BOOL returns ecore::EBoolean:
	'true' | 'false' | 'yes' | 'no';

terminal FLOAT returns ecore::EFloat:
	(INT '.' INT) ('e' ('-' | '+') INT)? ('f' | 'F' | 'd' | 'D')?;
	

QID:
	ID (('::' | '.') ID)*; 
	