-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use xmi parser for ecore and uml parser
- Loading branch information
Showing
5 changed files
with
26 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
import type { GraphModel } from '@cm2ml/ir' | ||
import { definePlugin } from '@cm2ml/plugin' | ||
import { compose, definePlugin } from '@cm2ml/plugin' | ||
import { XmiParser } from '@cm2ml/xmi-parser' | ||
|
||
export const EcoreParser = definePlugin({ | ||
export const EcoreRefiner = definePlugin({ | ||
name: 'ecore', | ||
parameters: {}, | ||
invoke: (input: string) => parse(input), | ||
invoke: (input: GraphModel) => refine(input), | ||
}) | ||
|
||
function parse(_ecore: string): GraphModel { | ||
// const document = parseDocument(uml, { | ||
// xmlMode: true, | ||
// }) | ||
throw new Error('Not yet implemented') | ||
// return new GraphModel(new GraphNode('TODO', {}, []), [], []) | ||
function refine(model: GraphModel): GraphModel { | ||
return model | ||
} | ||
|
||
export const EcoreParser = compose(XmiParser, EcoreRefiner, 'ecore') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
import type { GraphModel } from '@cm2ml/ir' | ||
import { definePlugin } from '@cm2ml/plugin' | ||
import { compose, definePlugin } from '@cm2ml/plugin' | ||
import { XmiParser } from '@cm2ml/xmi-parser' | ||
|
||
export const UmlParser = definePlugin({ | ||
export const UmlRefiner = definePlugin({ | ||
name: 'uml', | ||
parameters: {}, | ||
invoke: (input: string) => parse(input), | ||
invoke: (input: GraphModel) => refine(input), | ||
}) | ||
|
||
function parse(_uml: string): GraphModel { | ||
// const document = parseDocument(uml, { | ||
// xmlMode: true, | ||
// }) | ||
throw new Error('Not yet implemented') | ||
// return new GraphModel(new GraphNode('TODO', {}, []), [], []) | ||
function refine(model: GraphModel): GraphModel { | ||
return model | ||
} | ||
|
||
export const UmlParser = compose(XmiParser, UmlRefiner, 'uml') |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.