Commit cc8a6d67 authored by Loïc Correnson's avatar Loïc Correnson

[ivette] refactor api directory

parent 1468f10e
......@@ -3,7 +3,7 @@
/**
Ast Services
@packageDocumentation
@module api/kernel/ast
@module frama-c/api/kernel/ast
*/
//@ts-ignore
......@@ -16,21 +16,21 @@ import * as Server from 'frama-c/server';
import * as State from 'frama-c/states';
//@ts-ignore
import { byTag } from 'api/kernel/data';
import { byTag } from 'frama-c/api/kernel/data';
//@ts-ignore
import { byText } from 'api/kernel/data';
import { byText } from 'frama-c/api/kernel/data';
//@ts-ignore
import { jTag } from 'api/kernel/data';
import { jTag } from 'frama-c/api/kernel/data';
//@ts-ignore
import { jTagSafe } from 'api/kernel/data';
import { jTagSafe } from 'frama-c/api/kernel/data';
//@ts-ignore
import { jText } from 'api/kernel/data';
import { jText } from 'frama-c/api/kernel/data';
//@ts-ignore
import { jTextSafe } from 'api/kernel/data';
import { jTextSafe } from 'frama-c/api/kernel/data';
//@ts-ignore
import { tag } from 'api/kernel/data';
import { tag } from 'frama-c/api/kernel/data';
//@ts-ignore
import { text } from 'api/kernel/data';
import { text } from 'frama-c/api/kernel/data';
const compute_internal: Server.ExecRequest<null,null> = {
kind: Server.RqKind.EXEC,
......
......@@ -3,7 +3,7 @@
/**
Informations
@packageDocumentation
@module api/kernel/data
@module frama-c/api/kernel/data
*/
//@ts-ignore
......
......@@ -3,7 +3,7 @@
/**
Project Management
@packageDocumentation
@module api/kernel/project
@module frama-c/api/kernel/project
*/
//@ts-ignore
......
......@@ -3,7 +3,7 @@
/**
Property Services
@packageDocumentation
@module api/kernel/properties
@module frama-c/api/kernel/properties
*/
//@ts-ignore
......@@ -16,21 +16,21 @@ import * as Server from 'frama-c/server';
import * as State from 'frama-c/states';
//@ts-ignore
import { byTag } from 'api/kernel/data';
import { byTag } from 'frama-c/api/kernel/data';
//@ts-ignore
import { jTag } from 'api/kernel/data';
import { jTag } from 'frama-c/api/kernel/data';
//@ts-ignore
import { jTagSafe } from 'api/kernel/data';
import { jTagSafe } from 'frama-c/api/kernel/data';
//@ts-ignore
import { tag } from 'api/kernel/data';
import { tag } from 'frama-c/api/kernel/data';
//@ts-ignore
import { bySource } from 'api/kernel/services';
import { bySource } from 'frama-c/api/kernel/services';
//@ts-ignore
import { jSource } from 'api/kernel/services';
import { jSource } from 'frama-c/api/kernel/services';
//@ts-ignore
import { jSourceSafe } from 'api/kernel/services';
import { jSourceSafe } from 'frama-c/api/kernel/services';
//@ts-ignore
import { source } from 'api/kernel/services';
import { source } from 'frama-c/api/kernel/services';
/** Property Kinds */
export enum propKind {
......
......@@ -3,7 +3,7 @@
/**
Kernel Services
@packageDocumentation
@module api/kernel/services
@module frama-c/api/kernel/services
*/
//@ts-ignore
......@@ -16,13 +16,13 @@ import * as Server from 'frama-c/server';
import * as State from 'frama-c/states';
//@ts-ignore
import { byTag } from 'api/kernel/data';
import { byTag } from 'frama-c/api/kernel/data';
//@ts-ignore
import { jTag } from 'api/kernel/data';
import { jTag } from 'frama-c/api/kernel/data';
//@ts-ignore
import { jTagSafe } from 'api/kernel/data';
import { jTagSafe } from 'frama-c/api/kernel/data';
//@ts-ignore
import { tag } from 'api/kernel/data';
import { tag } from 'frama-c/api/kernel/data';
const getConfig_internal: Server.GetRequest<
null,
......
......@@ -3,7 +3,7 @@
/**
Dive Services
@packageDocumentation
@module api/plugins/dive
@module frama-c/api/plugins/dive
*/
//@ts-ignore
......@@ -16,21 +16,21 @@ import * as Server from 'frama-c/server';
import * as State from 'frama-c/states';
//@ts-ignore
import { byLocation } from 'api/kernel/ast';
import { byLocation } from 'frama-c/api/kernel/ast';
//@ts-ignore
import { byMarker } from 'api/kernel/ast';
import { byMarker } from 'frama-c/api/kernel/ast';
//@ts-ignore
import { jLocation } from 'api/kernel/ast';
import { jLocation } from 'frama-c/api/kernel/ast';
//@ts-ignore
import { jLocationSafe } from 'api/kernel/ast';
import { jLocationSafe } from 'frama-c/api/kernel/ast';
//@ts-ignore
import { jMarker } from 'api/kernel/ast';
import { jMarker } from 'frama-c/api/kernel/ast';
//@ts-ignore
import { jMarkerSafe } from 'api/kernel/ast';
import { jMarkerSafe } from 'frama-c/api/kernel/ast';
//@ts-ignore
import { location } from 'api/kernel/ast';
import { location } from 'frama-c/api/kernel/ast';
//@ts-ignore
import { marker } from 'api/kernel/ast';
import { marker } from 'frama-c/api/kernel/ast';
/** Parametrization of the exploration range. */
export interface range {
......
......@@ -3,7 +3,7 @@
/**
Eva General Services
@packageDocumentation
@module api/plugins/eva/general
@module frama-c/api/plugins/eva/general
*/
//@ts-ignore
......@@ -16,13 +16,13 @@ import * as Server from 'frama-c/server';
import * as State from 'frama-c/states';
//@ts-ignore
import { byMarker } from 'api/kernel/ast';
import { byMarker } from 'frama-c/api/kernel/ast';
//@ts-ignore
import { jMarker } from 'api/kernel/ast';
import { jMarker } from 'frama-c/api/kernel/ast';
//@ts-ignore
import { jMarkerSafe } from 'api/kernel/ast';
import { jMarkerSafe } from 'frama-c/api/kernel/ast';
//@ts-ignore
import { marker } from 'api/kernel/ast';
import { marker } from 'frama-c/api/kernel/ast';
const getCallers_internal: Server.GetRequest<
Json.key<'#fct'>,
......
......@@ -3,7 +3,7 @@
/**
Eva Values
@packageDocumentation
@module api/plugins/eva/values
@module frama-c/api/plugins/eva/values
*/
//@ts-ignore
......@@ -16,13 +16,13 @@ import * as Server from 'frama-c/server';
import * as State from 'frama-c/states';
//@ts-ignore
import { byMarker } from 'api/kernel/ast';
import { byMarker } from 'frama-c/api/kernel/ast';
//@ts-ignore
import { jMarker } from 'api/kernel/ast';
import { jMarker } from 'frama-c/api/kernel/ast';
//@ts-ignore
import { jMarkerSafe } from 'api/kernel/ast';
import { jMarkerSafe } from 'frama-c/api/kernel/ast';
//@ts-ignore
import { marker } from 'api/kernel/ast';
import { marker } from 'frama-c/api/kernel/ast';
/** CallStack */
export interface callstack {
......
......@@ -15,12 +15,20 @@ module TSC = Self.Action
let help = "Generate TypeScript API"
end)
module API = Self.String
(struct
let option_name = "-server-tsc-pkg"
let arg_name = "dir"
let default = "frama-c/api"
let help = Printf.sprintf "Output package (default is '%s')" default
end)
module OUT = Self.String
(struct
let option_name = "-server-tsc-out"
let arg_name = "dir"
let default = "api"
let help = "Output directory (default is './api')"
let default = "api/generated"
let help = Printf.sprintf "Output directory (default is '%s')" default
end)
module Md = Markdown
......@@ -474,12 +482,13 @@ let makeIgnore fmt msg =
let makePackage pkg name fmt =
begin
let open Pkg in
let framac = API.get () in
Format.fprintf fmt "/* --- Generated Frama-C Server API --- */@\n@\n" ;
Format.fprintf fmt "/**@\n %s@\n" pkg.p_title ;
if pkg.p_descr <> [] then
Format.fprintf fmt "@\n @[<hov 0>%a@]@\n@\n" pp_descr pkg.p_descr ;
Format.fprintf fmt " @@packageDocumentation@\n" ;
Format.fprintf fmt " @@module api/%s@\n" name ;
Format.fprintf fmt " @@module %s/%s@\n" framac name ;
Format.fprintf fmt "*/@\n@." ;
let names = Pkg.resolve ~keywords pkg in
makeIgnore fmt "import * as Json from 'dome/data/json';@\n" ;
......@@ -494,11 +503,11 @@ let makePackage pkg name fmt =
then
let pkg = Pkg.name_of_pkg ~sep:"/" id.plugin id.package in
if id.name = name then
makeIgnore fmt "import { %s } from 'api/%s';@\n"
name pkg
makeIgnore fmt "import { %s } from '%s/%s';@\n"
name framac pkg
else
makeIgnore fmt "import { %s: %s } from 'api/%s';@\n"
id.name name pkg
makeIgnore fmt "import { %s: %s } from '%s/%s';@\n"
id.name name framac pkg
) names ;
List.iter
(makeDeclaration fmt names)
......
......@@ -5,7 +5,7 @@ import * as Dome from 'dome';
import * as Server from 'frama-c/server';
import * as States from 'frama-c/states';
import * as API from 'api/plugins/dive';
import * as API from 'frama-c/api/plugins/dive';
import Cytoscape from 'cytoscape';
import CytoscapeComponent from 'react-cytoscapejs';
......
......@@ -479,7 +479,7 @@ export type HistorySelectActions = 'HISTORY_PREV' | 'HISTORY_NEXT';
/** A selection of multiple locations. */
export interface MultipleSelection {
/** The index of the current selected location in [[possibleSelections]]. */
/** The index of the current selected location in [[allSelections]]. */
index: number;
/** All locations forming a multiple selection. */
allSelections: Location[];
......
......@@ -9,7 +9,7 @@
import * as Dome from 'dome';
import * as DomeBuffers from 'dome/text/buffers';
import * as KernelData from 'api/kernel/data';
import * as KernelData from 'frama-c/api/kernel/data';
const D = new Dome.Debug('Utils');
......
......@@ -10,8 +10,7 @@ import { Vfill } from 'dome/layout/boxes';
import { RichTextBuffer } from 'dome/text/buffers';
import { Text } from 'dome/text/editors';
import { Component } from 'frama-c/LabViews';
import { getInfo } from 'api/kernel/ast';
import { getInfo } from 'frama-c/api/kernel/ast';
// --------------------------------------------------------------------------
// --- Information Panel
......
......@@ -15,8 +15,8 @@ import { RichTextBuffer } from 'dome/text/buffers';
import { Text } from 'dome/text/editors';
import { IconButton } from 'dome/controls/buttons';
import { Component, TitleBar } from 'frama-c/LabViews';
import { printFunction, markerInfo } from 'api/kernel/ast';
import { getCallers, getDeadCode } from 'api/plugins/eva/general';
import { printFunction, markerInfo } from 'frama-c/api/kernel/ast';
import { getCallers, getDeadCode } from 'frama-c/api/plugins/eva/general';
import 'codemirror/mode/clike/clike';
import 'codemirror/theme/ambiance.css';
......
......@@ -6,7 +6,7 @@ import React from 'react';
import { Section, Item } from 'dome/frame/sidebars';
import * as States from 'frama-c/states';
import { alpha } from 'dome/data/compare';
import { functions, functionsData } from 'api/kernel/ast';
import { functions, functionsData } from 'frama-c/api/kernel/ast';
// --------------------------------------------------------------------------
// --- Globals Section
......
......@@ -19,9 +19,9 @@ import { Scroll, Folder } from 'dome/layout/boxes';
import { RSplit } from 'dome/layout/splitters';
import { source as SourceLoc } from 'api/kernel/services';
import { statusData as Property } from 'api/kernel/properties';
import * as Properties from 'api/kernel/properties';
import { source as SourceLoc } from 'frama-c/api/kernel/services';
import { statusData as Property } from 'frama-c/api/kernel/properties';
import * as Properties from 'frama-c/api/kernel/properties';
// --------------------------------------------------------------------------
// --- Filters
......
......@@ -5,8 +5,8 @@
import React from 'react';
import * as States from 'frama-c/states';
import * as Json from 'dome/data/json';
import * as Eva from 'api/plugins/eva/values';
import * as Ast from 'api/kernel/ast';
import * as Eva from 'frama-c/api/plugins/eva/values';
import * as Ast from 'frama-c/api/kernel/ast';
import * as Compare from 'dome/data/compare';
import { Table, Column } from 'dome/table/views';
......
......@@ -43,7 +43,7 @@
"resolveJsonModule": true, /* Allow to load JSON files as module. */
"baseUrl": ".", /* Base directory to resolve non-absolute module names. */
"paths": { /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
"api/*": [ "api/*" ],
"frama-c/api/*": [ "api/generated/*" ],
"frama-c/*": [ "src/frama-c/*" ],
"dome": [ "src/dome/src/renderer/dome.tsx" ],
"dome/system": [ "src/dome/src/misc/system.js" ],
......@@ -103,7 +103,7 @@
"src/frama-c/server.ts",
"src/frama-c/states.ts",
"src/frama-c/utils.ts",
"api",
"api/generated",
"src/dome/src/renderer",
"src/dome/src/misc/utils.ts",
"src/dome/src/misc/system.ts",
......
......@@ -27,7 +27,7 @@ module.exports = {
resolve: {
extensions: ['.ts', '.tsx', '.js', 'jsx', '.json'],
alias: {
'api': path.resolve( __dirname , 'api' ),
'frama-c/api': path.resolve( __dirname , 'api/generated' ),
'frama-c': path.resolve( __dirname , 'src/frama-c' ),
'@plugins': path.resolve( __dirname , 'src/plugins' ),
'dome/misc': path.resolve( DOME , 'src/misc' ),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment