|
@@ -10,9 +10,16 @@ import { CompoundType } from '../../typeSystem/compoundType';
|
|
import { MultiType } from '../../typeSystem/multiType';
|
|
import { MultiType } from '../../typeSystem/multiType';
|
|
import { Config } from '../../util/config';
|
|
import { Config } from '../../util/config';
|
|
import { Store } from '../store/store';
|
|
import { Store } from '../store/store';
|
|
|
|
+import { IVProgParser } from '../../ast/ivprogParser';
|
|
|
|
|
|
export class SemanticAnalyser {
|
|
export class SemanticAnalyser {
|
|
|
|
|
|
|
|
+ static analyseFromSource (stringCode) {
|
|
|
|
+ const parser = IVProgParser.createParser(stringCode);
|
|
|
|
+ const semantic = new SemanticAnalyser(parser.parseTree());
|
|
|
|
+ return semantic.analyseTree();
|
|
|
|
+ }
|
|
|
|
+
|
|
constructor(ast) {
|
|
constructor(ast) {
|
|
this.ast = ast;
|
|
this.ast = ast;
|
|
this.lexerClass = LanguageService.getCurrentLexer();
|
|
this.lexerClass = LanguageService.getCurrentLexer();
|