From f922d132ac78bad47c64587115cd15d9cf3a75a5 Mon Sep 17 00:00:00 2001 From: Steve Hickman Date: Sat, 13 Jan 2024 11:30:01 -0800 Subject: [PATCH] Added 'import' --- .../src/com/epistimis/uddl/GenerateUddl.mwe2 | 4 ++++ .../src/com/epistimis/uddl/Uddl.xtext | 15 ++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/com.epistimis.uddl/src/com/epistimis/uddl/GenerateUddl.mwe2 b/com.epistimis.uddl/src/com/epistimis/uddl/GenerateUddl.mwe2 index 3689e6b..9f0c4e0 100644 --- a/com.epistimis.uddl/src/com/epistimis/uddl/GenerateUddl.mwe2 +++ b/com.epistimis.uddl/src/com/epistimis/uddl/GenerateUddl.mwe2 @@ -81,6 +81,10 @@ Workflow { projectWizard = { generate = true } + // https://idiomaticsoft.com/post/2022-05-16-xtext-importuri/ + scopeProvider = scoping.ImportNamespacesScopingFragment2 { + generateXtendStub = false + } } } } diff --git a/com.epistimis.uddl/src/com/epistimis/uddl/Uddl.xtext b/com.epistimis.uddl/src/com/epistimis/uddl/Uddl.xtext index 78dfe88..cd8266b 100644 --- a/com.epistimis.uddl/src/com/epistimis/uddl/Uddl.xtext +++ b/com.epistimis.uddl/src/com/epistimis/uddl/Uddl.xtext @@ -4,11 +4,11 @@ generate uddl "http://www.epistimis.com/uddl/Uddl" import "http://www.eclipse.org/emf/2002/Ecore" as ecore -//// Starter rule comes first -//ModelFile: -// includes+=Include* -// dataModel=DataModel -//; +// Starter rule comes first +ModelFile: + (includes+=Include)* + dataModel=DataModel +; /** A DataModel is a container for ConceptualDataModels, LogicalDataModels, and PlatformDataModels */ DataModel: @@ -37,10 +37,11 @@ QN: ID ('.' ID)*; /** - * Use 'include' because 'import' is an XBase keyword + * Use 'include' because 'import' is an XBase keyword ? + * Probably not - examples use 'import' and doc knows of XBase */ Include: - 'include' importedNamespace=QualifiedNameWithWildcard; + 'import' importedNamespace=QualifiedNameWithWildcard ';' ; /** * Already defined in XBase