blob: b85a0335d74ac2a6076c27e2016bb9403b0183c5 [file] [log] [blame]
/*
* Copyright (c) 2007, 2009 Borland Software Corporation
*
* 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:
* Dmitry Stadnik (Borland) - initial API and implementation
*/
import xpt.StringOperations;
modeltype gmfgen uses "http://www.eclipse.org/gmf/2009/GenModel";
library ParserUtils;
helper parserFieldName(element : gmfgen::GenCommonBase) : String {
return element.getUniqueIdentifier().xpandToFirstLower() + 'Parser'
}
helper parserAccessorName(element : gmfgen::GenCommonBase) : String {
return 'get' + element.getUniqueIdentifier().firstToUpper() + 'Parser'
}
helper isPatternSpecified(pattern : String) : Boolean {
return (not pattern.oclIsUndefined()) and pattern.size() > 0
}