diff options
Diffstat (limited to 'extraplugins/marte/org.eclipse.papyrus.marte.vsl/src-gen/org/eclipse/papyrus/marte/vsl/parser/antlr/VSLParser.java')
-rw-r--r-- | extraplugins/marte/org.eclipse.papyrus.marte.vsl/src-gen/org/eclipse/papyrus/marte/vsl/parser/antlr/VSLParser.java | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/extraplugins/marte/org.eclipse.papyrus.marte.vsl/src-gen/org/eclipse/papyrus/marte/vsl/parser/antlr/VSLParser.java b/extraplugins/marte/org.eclipse.papyrus.marte.vsl/src-gen/org/eclipse/papyrus/marte/vsl/parser/antlr/VSLParser.java new file mode 100644 index 00000000000..d9e11cdb07b --- /dev/null +++ b/extraplugins/marte/org.eclipse.papyrus.marte.vsl/src-gen/org/eclipse/papyrus/marte/vsl/parser/antlr/VSLParser.java @@ -0,0 +1,66 @@ +/***************************************************************************** + * Copyright (c) 2010 CEA LIST. + * + * + * 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: + * CEA LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.marte.vsl.parser.antlr; + +import org.antlr.runtime.CharStream; +import org.antlr.runtime.TokenSource; +import org.eclipse.xtext.parser.IParseResult; +import org.eclipse.xtext.parser.ParseException; +import org.eclipse.xtext.parser.antlr.XtextTokenStream; + +import com.google.inject.Inject; + +import org.eclipse.papyrus.marte.vsl.services.VSLGrammarAccess; + +public class VSLParser extends org.eclipse.xtext.parser.antlr.AbstractAntlrParser { + + @Inject + private VSLGrammarAccess grammarAccess; + + @Override + protected IParseResult parse(String ruleName, CharStream in) { + TokenSource tokenSource = createLexer(in); + XtextTokenStream tokenStream = createTokenStream(tokenSource); + tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT"); + org.eclipse.papyrus.marte.vsl.parser.antlr.internal.InternalVSLParser parser = createParser(tokenStream); + parser.setTokenTypeMap(getTokenDefProvider().getTokenDefMap()); + parser.setSyntaxErrorProvider(getSyntaxErrorProvider()); + parser.setUnorderedGroupHelper(getUnorderedGroupHelper().get()); + try { + if(ruleName != null) + return parser.parse(ruleName); + return parser.parse(); + } catch (Exception re) { + throw new ParseException(re.getMessage(),re); + } + } + + protected org.eclipse.papyrus.marte.vsl.parser.antlr.internal.InternalVSLParser createParser(XtextTokenStream stream) { + return new org.eclipse.papyrus.marte.vsl.parser.antlr.internal.InternalVSLParser(stream, getElementFactory(), getGrammarAccess()); + } + + @Override + protected String getDefaultRuleName() { + return "Expression"; + } + + public VSLGrammarAccess getGrammarAccess() { + return this.grammarAccess; + } + + public void setGrammarAccess(VSLGrammarAccess grammarAccess) { + this.grammarAccess = grammarAccess; + } + +} |