The idea would be to translate the source language into an abstract internal representation.
In the case of Oberon, we simply use the compiler front end as a parser and build an abstract syntax tree.
For other languages, it suffices to parse the source program with an appropriate parser.
The difficulty is to define an abstract syntax tree that matches with all programming languages.
Up to now, we implemented a parser for Java programs but we have not yet embedded all language constructs of Java into our internal representation.
Our program slicing tool then works on the internal representation and computes slicing information via control flow and data flow analysis.
How the slicing information is presented to the user is mainly a user-interface issue but also to some degree language specific.