Skip to content

Commit

Permalink
update Manifests
Browse files Browse the repository at this point in the history
  • Loading branch information
tjeske committed Sep 3, 2023
1 parent e91f670 commit ad74e99
Show file tree
Hide file tree
Showing 18 changed files with 80 additions and 114 deletions.
1 change: 0 additions & 1 deletion org.eclipse.xpect.examples/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ Require-Bundle: org.eclipse.xtend.lib,
org.eclipse.xpect.xtext.lib;bundle-version="0.1.0",
org.eclipse.xtend.ide;bundle-version="2.4.0",
org.eclipse.xtext.xtext.ui;bundle-version="2.4.0",
org.eclipse.xtend;bundle-version="1.3.0",
org.eclipse.emf.codegen;bundle-version="2.8.0"
Automatic-Module-Name: org.eclipse.xpect.examples
4 changes: 2 additions & 2 deletions org.eclipse.xpect.ide/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ Require-Bundle: org.eclipse.xpect,
org.antlr.runtime;bundle-version="[3.2.0,3.2.1)"
Bundle-RequiredExecutionEnvironment: JavaSE-11
Export-Package: org.eclipse.xpect.ide.contentassist.antlr,
org.eclipse.xpect.ide.contentassist.antlr.internal,
org.eclipse.xpect.ide.contentassist.antlr.lexer,
org.eclipse.xpect.lexer
org.eclipse.xpect.lexer,
org.eclipse.xpect.ide.contentassist.antlr.internal
4 changes: 2 additions & 2 deletions org.eclipse.xpect.mwe2/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ Require-Bundle: com.google.guava,
org.eclipse.xtext.xbase.lib,
org.eclipse.xtend.lib,
org.eclipse.xtend.lib.macro,
org.eclipse.xtext;bundle-version="2.31.0",
org.eclipse.xtext.generator;bundle-version="2.31.0"
org.eclipse.xtext,
org.eclipse.xtext.xtext.generator;bundle-version="2.31.0"
1 change: 1 addition & 0 deletions org.eclipse.xpect.mwe2/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ source.. = src/,\
bin.includes = .,\
META-INF/
bin.excludes = **/*.xtend
additional.bundles = org.eclipse.xtext.xtext.generator
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
*******************************************************************************/
package org.eclipse.xpect.mwe2.statefullexer

import com.google.common.collect.LinkedHashMultimap
import com.google.common.collect.Multimap
import java.util.List
import java.util.Set
import org.eclipse.emf.ecore.EObject
import org.eclipse.xtend.lib.annotations.Accessors
import org.eclipse.xtend.lib.annotations.Data
import org.eclipse.xtext.AbstractElement
import org.eclipse.xtext.AbstractRule
Expand All @@ -33,9 +32,7 @@ import org.eclipse.xtext.util.formallang.Pda
import org.eclipse.xtext.util.formallang.PdaFactory

import static extension org.eclipse.xpect.mwe2.statefullexer.Util.*
import static extension org.eclipse.xtext.EcoreUtil2.*
import static extension org.eclipse.xtext.GrammarUtil.*
import org.eclipse.xtend.lib.annotations.Accessors

class LexerStatesProvider implements ILexerStatesProvider {

Expand Down Expand Up @@ -142,7 +139,7 @@ class LexerStatesProvider implements ILexerStatesProvider {
}
}
for(from : all)
if(from.token != null && !consumed.contains(from)) {
if(from.token !== null && !consumed.contains(from)) {
val fromGroup = nfa.getGroupFromState(from)
states.get(fromGroup).elements.add(from.token)
}
Expand All @@ -159,41 +156,6 @@ class LexerStatesProvider implements ILexerStatesProvider {
<AbstractRule>newLinkedHashSet()
}

def private Multimap<AbstractRule, EObject> getTerminalOwner(Grammar grammar) {
val result = LinkedHashMultimap::<AbstractRule, EObject>create()
val startrule = grammar.allParserRules.get(0)
val starthidden = grammar.hidden
collectTerminalOwner(startrule, startrule, result, starthidden.toList, newHashSet)
result
}

def private void collectTerminalOwner(AbstractRule rule, AbstractRule owner, Multimap<AbstractRule, EObject> owner2terminal, List<AbstractRule> hidden, Set<Pair<AbstractRule, AbstractRule>> visited) {
val matches = rule.space
val newOwner = if(matches) rule else owner
if(!visited.add(rule -> owner))
return;
val definesHidden = rule instanceof ParserRule && (rule as ParserRule).definesHiddenTokens
val newHidden = if(definesHidden) (rule as ParserRule).hiddenTokens else hidden
if(matches || definesHidden)
for(h:newHidden)
owner2terminal.put(newOwner, h)
for(e:rule.eAllContentsAsList)
switch(e) {
Keyword: owner2terminal.put(newOwner, e)
RuleCall case e.rule instanceof TerminalRule: owner2terminal.put(newOwner, e)
RuleCall: collectTerminalOwner(e.rule, newOwner, owner2terminal, newHidden, visited)
}
}

def private Multimap<AbstractElement, AbstractElement> getFollowerMap(Grammar grammar) {
val nfa = grammar.nfa
val result = LinkedHashMultimap::<AbstractElement, AbstractElement>create()
for(e: new NfaUtil().collect(nfa))
for(f:nfa.getFollowers(e))
result.put(e.token, f.token)
result
}

def Pda<TokenPDA.TokenPDAState<AbstractElement>, RuleCall> getPda(Grammar grammar) {
val cfg = new StatesCfgAdapter(grammar)
val ff = new FollowerFunctionImpl(cfg).setFilter[it instanceof Keyword || it instanceof RuleCall]
Expand Down Expand Up @@ -249,7 +211,7 @@ class LexicalGroup {
}

override equals(Object obj) {
if(obj == null || ^class != obj.^class)
if(obj === null || ^class != obj.^class)
return false;
val other = obj as LexicalGroup
group == other.group
Expand Down Expand Up @@ -286,7 +248,7 @@ class LaxicalGroupsTraverserItem {
def LaxicalGroupsTraverserItem push(RuleCall item) {
var count = 0;
var current = this;
while (current != null) {
while (current !== null) {
if (current.item == item)
count = count + 1
current = current.parent;
Expand All @@ -308,7 +270,7 @@ class LaxicalGroupsTraverserItem {
}

def LaxicalGroupsTraverserItem pop(RuleCall item) {
if (parent == null || this.item != item)
if (parent === null || this.item != item)
return null;
return parent;
}
Expand All @@ -323,17 +285,17 @@ class LaxicalGroupsTraverserItem {

override enter(Pda<TokenPDA.TokenPDAState<AbstractElement>,RuleCall> pda, TokenPDA.TokenPDAState<AbstractElement> state, LaxicalGroupsTraverserItem previous) {
var RuleCall item;
if ((item = pda.getPush(state)) != null)
if ((item = pda.getPush(state)) !== null)
return previous.push(item)
if ((item = pda.getPop(state)) != null)
if ((item = pda.getPop(state)) !== null)
return previous.pop(item)
if (previous == null)
if (previous === null)
return new LaxicalGroupsTraverserItem(group)
return previous;
}

override isSolution(LaxicalGroupsTraverserItem result) {
return result.parent == null;
return result.parent === null;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
@SuppressWarnings("restriction")
public class NfaToDot2 extends GraphvizDotBuilder2 {

@SuppressWarnings("unchecked")
protected Edge create(Props result, Nfa<Object> nfa, Object from, Object to) {
Edge edge = new Edge(from, to);
if (nfa instanceof NfaWithTransitions<?, ?>) {
Expand Down
16 changes: 8 additions & 8 deletions org.eclipse.xpect.ui/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ Bundle-Vendor: %providerName
Bundle-Version: 0.2.0.qualifier
Bundle-SymbolicName: org.eclipse.xpect.ui;singleton:=true
Bundle-ActivationPolicy: lazy
Require-Bundle: org.eclipse.xpect;bundle-version="[0.2.0,0.2.1)";visibility:=reexport,
org.eclipse.xpect.ide;bundle-version="0.2.0",
Require-Bundle: org.eclipse.xpect,
org.eclipse.xpect.ide,
org.eclipse.xtext.ui,
org.eclipse.ui.editors;bundle-version="3.7.0",
org.eclipse.ui.ide;bundle-version="3.7.0",
org.eclipse.xtext.ui.ecore;resolution:=optional,
org.eclipse.xtext.ui.shared,
org.eclipse.xtext.builder,
org.eclipse.xtext.ui.codetemplates.ui,
org.eclipse.ui.editors;bundle-version="3.14.300",
org.eclipse.ui.ide;bundle-version="3.18.500",
org.eclipse.ui,
org.antlr.runtime,
org.eclipse.xtext.ui.ecore;resolution:=optional,
org.eclipse.xtext.common.types.ui,
org.eclipse.xtext.ui.codetemplates.ui,
org.eclipse.jdt.core;bundle-version="3.7.0",
org.eclipse.compare,
org.eclipse.jdt.core;bundle-version="3.7.0"
org.eclipse.xtext.builder
Import-Package: org.apache.log4j
Bundle-RequiredExecutionEnvironment: JavaSE-11
Bundle-Activator: org.eclipse.xpect.ui.XpectPluginActivator
Expand Down
6 changes: 3 additions & 3 deletions org.eclipse.xpect.xtext.lib.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Bundle-Vendor: %providerName
Bundle-Version: 0.2.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Bundle: org.eclipse.xpect.xtext.lib;bundle-version="0.2.0",
org.eclipse.xtext.ui;bundle-version="2.31.0",
org.eclipse.xtext.xtext.ui;bundle-version="2.31.0",
org.eclipse.xtext.ui.shared;bundle-version="2.31.0"
org.eclipse.xtext.ui,
org.eclipse.xtext.xtext.ui,
org.eclipse.xtext.ui.shared
Automatic-Module-Name: org.eclipse.xpect.xtext.lib.tests
6 changes: 3 additions & 3 deletions org.eclipse.xpect.xtext.lib/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Bundle-Version: 0.2.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0";visibility:=reexport,
org.eclipse.core.resources;bundle-version="3.7.0";visibility:=reexport,
org.eclipse.xpect;bundle-version="[0.2.0,0.2.1)";visibility:=reexport,
org.eclipse.xpect.ui;bundle-version="[0.2.0,0.2.1)";visibility:=reexport,
org.eclipse.xtext.ui;bundle-version="2.31.0";visibility:=reexport,
org.eclipse.xpect;visibility:=reexport,
org.eclipse.xpect.ui;visibility:=reexport,
org.eclipse.xtext.ui;visibility:=reexport,
org.eclipse.jdt.core;bundle-version="3.7.0";visibility:=reexport,
org.eclipse.ui.ide;bundle-version="3.7.0";visibility:=reexport,
org.eclipse.xtext.xbase.lib
Expand Down
7 changes: 4 additions & 3 deletions org.eclipse.xpect.xtext.xbase.lib/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.7.0";visibility:=reex
org.eclipse.core.resources;bundle-version="3.7.0";visibility:=reexport,
org.eclipse.xpect;bundle-version="[0.2.0,0.2.1)";visibility:=reexport,
org.eclipse.xpect.ui;bundle-version="[0.2.0,0.2.1)";visibility:=reexport,
org.eclipse.xtext.xbase;bundle-version="2.31.0",
org.eclipse.xtext.ui;bundle-version="2.31.0";visibility:=reexport,
org.eclipse.xtext.xbase,
org.eclipse.xtext.ui;visibility:=reexport,
org.eclipse.jdt.core;bundle-version="3.7.0";visibility:=reexport,
org.eclipse.ui.ide;bundle-version="3.7.0";visibility:=reexport,
org.eclipse.xpect.xtext.lib;bundle-version="[0.2.0,0.2.1)",
org.eclipse.xtext.xbase.junit;bundle-version="2.31.0"
org.eclipse.xtext.xbase.junit,
org.eclipse.xtext.xbase.testing;bundle-version="2.31.0"
Export-Package: org.eclipse.xpect.xtext.xbase.lib,
org.eclipse.xpect.xtext.xbase.lib.tests
Automatic-Module-Name: org.eclipse.xpect.xtext.xbase.lib
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@

import java.util.Map;

import org.eclipse.xtext.generator.GeneratorContext;
import org.eclipse.xtext.generator.GeneratorDelegate;
import org.eclipse.xtext.generator.IGeneratorContext;
import org.eclipse.xtext.resource.XtextResource;
import org.eclipse.xtext.util.JavaVersion;
import org.eclipse.xtext.xbase.compiler.OnTheFlyJavaCompiler2;
import org.eclipse.xtext.xbase.compiler.RegisteringFileSystemAccess;
import org.eclipse.xtext.xbase.compiler.RegisteringFileSystemAccess.GeneratedFile;
import org.junit.runner.RunWith;
import org.eclipse.xpect.XpectImport;
import org.eclipse.xpect.expectation.IStringExpectation;
import org.eclipse.xpect.expectation.StringExpectation;
Expand All @@ -34,6 +25,15 @@
import org.eclipse.xpect.xtext.lib.setup.XtextStandaloneSetup;
import org.eclipse.xpect.xtext.lib.setup.XtextWorkspaceSetup;
import org.eclipse.xpect.xtext.lib.util.InMemoryFileSystemAccessFormatter;
import org.eclipse.xtext.generator.GeneratorContext;
import org.eclipse.xtext.generator.GeneratorDelegate;
import org.eclipse.xtext.generator.IGeneratorContext;
import org.eclipse.xtext.resource.XtextResource;
import org.eclipse.xtext.util.JavaVersion;
import org.eclipse.xtext.xbase.testing.OnTheFlyJavaCompiler2;
import org.eclipse.xtext.xbase.testing.RegisteringFileSystemAccess;
import org.eclipse.xtext.xbase.testing.RegisteringFileSystemAccess.GeneratedFile;
import org.junit.runner.RunWith;

import com.google.common.collect.Maps;
import com.google.inject.Inject;
Expand Down
37 changes: 16 additions & 21 deletions org.eclipse.xpect/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,23 @@ Bundle-SymbolicName: org.eclipse.xpect;singleton:=true
Automatic-Module-Name: org.eclipse.xpect
Bundle-ActivationPolicy: lazy
Require-Bundle: org.eclipse.xpect.mwe2;bundle-version="0.2.0",
org.apache.log4j;bundle-version="1.2.0";visibility:=reexport,
org.junit;bundle-version="4.11.0";visibility:=reexport,
org.antlr.runtime;bundle-version="3.2.0",
org.eclipse.xtext;bundle-version="2.31.0";visibility:=reexport,
org.eclipse.xtext.util;bundle-version="2.31.0";visibility:=reexport,
org.eclipse.emf.ecore;bundle-version="2.7.0";visibility:=reexport,
org.eclipse.emf.common;bundle-version="2.7.0";visibility:=reexport,
org.eclipse.xtext.common.types;bundle-version="2.31.0";visibility:=reexport,
org.eclipse.xtext.generator;resolution:=optional,
org.apache.commons.logging;bundle-version="1.0.4";resolution:=optional,
org.eclipse.emf.codegen.ecore;resolution:=optional,
org.eclipse.emf.mwe.utils;resolution:=optional,
org.eclipse.emf.mwe2.launch;resolution:=optional,
org.eclipse.emf.mwe2.lib;resolution:=optional,
org.eclipse.xtext.ecore;bundle-version="2.31.0";resolution:=optional,
org.objectweb.asm;bundle-version="[3.0.0,10.0.0)";resolution:=optional,
org.eclipse.equinox.common;bundle-version="3.0.0";resolution:=optional,
org.eclipse.core.runtime;bundle-version="3.0.0";resolution:=optional,
org.eclipse.xtext,
org.eclipse.xtext.xbase,
org.eclipse.equinox.common;bundle-version="3.16.0",
org.eclipse.core.runtime,
org.eclipse.emf.ecore;visibility:=reexport,
org.eclipse.xtext.xbase.lib;bundle-version="2.14.0",
org.eclipse.xtext.util,
org.eclipse.emf.common,
org.antlr.runtime;bundle-version="[3.2.0,3.2.1)",
org.apache.log4j;bundle-version="1.2.24",
io.github.classgraph;bundle-version="4.8.35";visibility:=reexport,
org.eclipse.xtext.xbase.lib;bundle-version="2.31.0"
Import-Package: org.apache.log4j
org.junit;bundle-version="4.11.0";visibility:=reexport,
org.eclipse.xtext.common.types;visibility:=reexport,
org.apache.log4j;bundle-version="1.2.0";visibility:=reexport,
org.objectweb.asm;bundle-version="[9.5.0,9.6.0)";resolution:=optional
Bundle-RequiredExecutionEnvironment: JavaSE-11
Export-Package: org.eclipse.xpect,
org.eclipse.xpect.model,
org.eclipse.xpect.expectation,
org.eclipse.xpect.expectation.impl;
x-friends:="org.eclipse.xpect.xtext.lib,
Expand All @@ -41,6 +34,7 @@ Export-Package: org.eclipse.xpect,
org.eclipse.xpect.lexer;
x-friends:="org.eclipse.xpect.tests",
org.eclipse.xpect.lib,
org.eclipse.xpect.model,
org.eclipse.xpect.parameter,
org.eclipse.xpect.parser.antlr,
org.eclipse.xpect.parser.antlr.internal,
Expand All @@ -55,3 +49,4 @@ Export-Package: org.eclipse.xpect,
org.eclipse.xpect.text,
org.eclipse.xpect.util,
org.eclipse.xpect.validation
Import-Package: org.apache.log4j
10 changes: 10 additions & 0 deletions org.eclipse.xpect/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,13 @@ bin.includes = META-INF/,\
plugin.properties,\
model/,\
schema/
additional.bundles = org.eclipse.xtext.xbase,\
org.eclipse.xtext.common.types,\
org.eclipse.xtext.xtext.generator,\
org.eclipse.emf.codegen.ecore,\
org.eclipse.emf.mwe.utils,\
org.eclipse.emf.mwe2.launch,\
org.eclipse.emf.mwe2.lib,\
org.objectweb.asm,\
org.apache.commons.logging,\
org.apache.log4j
3 changes: 1 addition & 2 deletions org.eclipse.xpect/src/org/eclipse/xpect/Xpect.xtext
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ grammar org.eclipse.xpect.Xpect hidden()
import "http://www.eclipse.org/xpect/Xpect"

import "http://www.eclipse.org/emf/2002/Ecore" as ecore
import "platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.ecore" as types
//import "http://www.eclipse.org/xtext/common/JavaVMTypes" as types
import "http://www.eclipse.org/xtext/common/JavaVMTypes" as types
import "http://www.eclipse.org/xpect/XpectJavaModel" as xjm

XpectFile:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public IEPackageInfo getInfo() {
public static void register(IEPackageInfo info) {
EPackage.Registry.INSTANCE.put(info.getNamespaceURI(), new EPackageDescriptorImpl(info));
if (info.getGenmodel() != null)
EcorePlugin.getEPackageNsURIToGenModelLocationMap().put(info.getNamespaceURI(), URI.createURI(info.getGenmodel()));
EcorePlugin.getEPackageNsURIToGenModelLocationMap(false).put(info.getNamespaceURI(), URI.createURI(info.getGenmodel()));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static XpectJavaModel createJavaModel(Class<?> clazz) {
XtextResourceSet rs = new XtextResourceSet();
ClassLoader classLoader = clazz.getClassLoader();
rs.setClasspathURIContext(classLoader);
new ClasspathTypeProvider(classLoader, rs, null);
new ClasspathTypeProvider(classLoader, rs, null, null);
JvmTypeReference typeReference = getTypeReferences().getTypeForName(clazz, rs);
return createJavaModel(rs, (JvmDeclaredType) typeReference.getType());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@

import java.math.BigDecimal;

import org.eclipse.xtext.example.arithmetics.arithmetics.Expression;
import org.eclipse.xtext.example.arithmetics.interpreter.Calculator;
import org.junit.runner.RunWith;
import org.eclipse.xpect.XpectImport;
import org.eclipse.xpect.expectation.IStringExpectation;
import org.eclipse.xpect.expectation.StringExpectation;
import org.eclipse.xpect.runner.Xpect;
import org.eclipse.xpect.runner.XpectRunner;
import org.eclipse.xpect.runner.XpectTestFiles;
import org.eclipse.xpect.runner.XpectTestFiles.FileRoot;
import org.eclipse.xpect.setup.XpectSetup;
import org.eclipse.xpect.xtext.lib.setup.ThisOffset;
import org.eclipse.xpect.xtext.lib.setup.XtextStandaloneSetup;
import org.eclipse.xpect.xtext.lib.setup.XtextWorkspaceSetup;
import org.eclipse.xtext.example.arithmetics.arithmetics.Expression;
import org.eclipse.xtext.example.arithmetics.interpreter.Calculator;
import org.junit.runner.RunWith;

@RunWith(XpectRunner.class)
@XpectSetup({ XtextStandaloneSetup.class, XtextWorkspaceSetup.class })
@XpectImport({ XtextStandaloneSetup.class, XtextWorkspaceSetup.class })
@XpectTestFiles(relativeTo = FileRoot.SOURCE, files = "org/eclipse/xtext/example/arithmetics/xpect/tests/interpreter/test.calc.xt")
public class InterpreterTest {

Expand Down
Loading

0 comments on commit ad74e99

Please sign in to comment.