private static void parseText(File file, String fileText, boolean packagePeer, boolean useExternalContext,
CodeContext codeContext) throws IOException, CommonException {
final IProject project = codeContext.project;
Lexer lexer = new Lexer();
Tokenizer tokenizer = new Tokenizer(lexer);
PackageParser packageParser = new PackageParser(tokenizer, file);
ImportParser importParser = new ImportParser(tokenizer, file);
ScopeParser scopeParser = new ScopeParser(tokenizer, file);
FunctionParser functionParser = new FunctionParser(false, tokenizer, file);
functionParser.setScopeParser(scopeParser);
TypeParser typeParser = new TypeParser(false, tokenizer, file);
typeParser.setScopeParser(scopeParser);
VariableParser variableParser = new VariableParser(tokenizer, file, functionParser);
variableParser.setScopeParser(scopeParser);
// InterfaceParser interfaceParser = new InterfaceParser(tokenizer);
lexer.scan(fileText);
if (!packagePeer) {
codeContext.page = new TokenizedPage(tokenizer.getTokenizedStream());
codeContext.pkg = packageParser.getPckg();
codeContext.imports.addAll(importParser.getImports());