Ragex.Analyzers.SCIP.Parser (Ragex v0.15.0)

View Source

Parses SCIP index JSON (from scip print --json) into Ragex's internal analysis format.

Zero external dependencies -- uses OTP's :json.decode/1 for parsing and maps SCIP's document/symbol/occurrence model to Ragex's %{modules, functions, calls, imports} shape.

SCIP Model -> Ragex Model Mapping

  • SCIP Document -> one or more Ragex modules (grouped by namespace)
  • SCIP SymbolInformation with Suffix.Type or Suffix.Namespace -> :module node
  • SCIP SymbolInformation with Suffix.Method or Suffix.Term -> :function node
  • SCIP Occurrence with definition role -> defines edge
  • SCIP Occurrence with reference role -> calls edge

Summary

Functions

Parse a SCIP JSON string into Ragex analysis result format.

Parse a SCIP JSON string into a simplified flat list of symbols with their locations. Useful for quick inspection.

Functions

parse(json_string, project_root)

@spec parse(String.t(), String.t()) :: {:ok, map()} | {:error, term()}

Parse a SCIP JSON string into Ragex analysis result format.

Parameters

  • json_string -- output of scip print --json index.scip
  • project_root -- absolute path to the project root (for file resolution)

Returns

{:ok, analysis_result} matching Ragex.Analyzers.Behaviour.analysis_result()

parse_symbols(json_string)

@spec parse_symbols(String.t()) :: {:ok, [map()]} | {:error, term()}

Parse a SCIP JSON string into a simplified flat list of symbols with their locations. Useful for quick inspection.