Language Services

Parse

parseCode

Parse a file and return the corresponding AST


/parse/{languageId}

Usage and SDK Samples

curl -X POST\
-H "Content-Type: text"\
"http://api.languageservices.dev/v1/parse/{languageId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.ParseApi;

import java.io.File;
import java.util.*;

public class ParseApiExample {

    public static void main(String[] args) {
        
        ParseApi apiInstance = new ParseApi();
        String languageId = languageId_example; // String | should indicate a supported language. At this time COBOL and PLSQL are the values supported
        String body = ; // String | The code to parse.
        try {
            apiInstance.parseCode(languageId, body);
        } catch (ApiException e) {
            System.err.println("Exception when calling ParseApi#parseCode");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.ParseApi;

public class ParseApiExample {

    public static void main(String[] args) {
        ParseApi apiInstance = new ParseApi();
        String languageId = languageId_example; // String | should indicate a supported language. At this time COBOL and PLSQL are the values supported
        String body = ; // String | The code to parse.
        try {
            apiInstance.parseCode(languageId, body);
        } catch (ApiException e) {
            System.err.println("Exception when calling ParseApi#parseCode");
            e.printStackTrace();
        }
    }
}
String *languageId = languageId_example; // should indicate a supported language. At this time COBOL and PLSQL are the values supported
String *body = ; // The code to parse. (optional)

ParseApi *apiInstance = [[ParseApi alloc] init];

// Parse a file and return the corresponding AST
[apiInstance parseCodeWith:languageId
    body:body
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var LanguageServices = require('language_services');

var api = new LanguageServices.ParseApi()
var languageId = languageId_example; //  should indicate a supported language. At this time COBOL and PLSQL are the values supported
var opts = { 
  'body':  //  The code to parse.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.parseCode(languageId, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class parseCodeExample
    {
        public void main()
        {

            var apiInstance = new ParseApi();
            var languageId = languageId_example;  // String | should indicate a supported language. At this time COBOL and PLSQL are the values supported
            var body = new String(); // String | The code to parse. (optional) 

            try
            {
                // Parse a file and return the corresponding AST
                apiInstance.parseCode(languageId, body);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ParseApi.parseCode: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiParseApi();
$languageId = languageId_example; // String | should indicate a supported language. At this time COBOL and PLSQL are the values supported
$body = ; // String | The code to parse.

try {
    $api_instance->parseCode($languageId, $body);
} catch (Exception $e) {
    echo 'Exception when calling ParseApi->parseCode: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::ParseApi;

my $api_instance = WWW::SwaggerClient::ParseApi->new();
my $languageId = languageId_example; # String | should indicate a supported language. At this time COBOL and PLSQL are the values supported
my $body = WWW::SwaggerClient::Object::String->new(); # String | The code to parse.

eval { 
    $api_instance->parseCode(languageId => $languageId, body => $body);
};
if ($@) {
    warn "Exception when calling ParseApi->parseCode: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.ParseApi()
languageId = languageId_example # String | should indicate a supported language. At this time COBOL and PLSQL are the values supported
body =  # String | The code to parse. (optional)

try: 
    # Parse a file and return the corresponding AST
    api_instance.parse_code(languageId, body=body)
except ApiException as e:
    print("Exception when calling ParseApi->parseCode: %s\n" % e)

Parameters

Path parameters
Name Description
languageId*
String
should indicate a supported language. At this time COBOL and PLSQL are the values supported
Required
Body parameters
Name Description
body

Responses

Status: 200 - OK


Schema

schemaAst

Returns the JSON Schema of the AST created by the corresponding parser


/schema/{languageId}

Usage and SDK Samples

curl -X GET\
"http://api.languageservices.dev/v1/schema/{languageId}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.SchemaApi;

import java.io.File;
import java.util.*;

public class SchemaApiExample {

    public static void main(String[] args) {
        
        SchemaApi apiInstance = new SchemaApi();
        String languageId = languageId_example; // String | should indicate a supported language. At this time COBOL and PLSQL are the values supported
        try {
            apiInstance.schemaAst(languageId);
        } catch (ApiException e) {
            System.err.println("Exception when calling SchemaApi#schemaAst");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.SchemaApi;

public class SchemaApiExample {

    public static void main(String[] args) {
        SchemaApi apiInstance = new SchemaApi();
        String languageId = languageId_example; // String | should indicate a supported language. At this time COBOL and PLSQL are the values supported
        try {
            apiInstance.schemaAst(languageId);
        } catch (ApiException e) {
            System.err.println("Exception when calling SchemaApi#schemaAst");
            e.printStackTrace();
        }
    }
}
String *languageId = languageId_example; // should indicate a supported language. At this time COBOL and PLSQL are the values supported

SchemaApi *apiInstance = [[SchemaApi alloc] init];

// Returns the JSON Schema of the AST created by the corresponding parser
[apiInstance schemaAstWith:languageId
              completionHandler: ^(NSError* error) {
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var LanguageServices = require('language_services');

var api = new LanguageServices.SchemaApi()
var languageId = languageId_example; //  should indicate a supported language. At this time COBOL and PLSQL are the values supported

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.schemaAst(languageId, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class schemaAstExample
    {
        public void main()
        {

            var apiInstance = new SchemaApi();
            var languageId = languageId_example;  // String | should indicate a supported language. At this time COBOL and PLSQL are the values supported

            try
            {
                // Returns the JSON Schema of the AST created by the corresponding parser
                apiInstance.schemaAst(languageId);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SchemaApi.schemaAst: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiSchemaApi();
$languageId = languageId_example; // String | should indicate a supported language. At this time COBOL and PLSQL are the values supported

try {
    $api_instance->schemaAst($languageId);
} catch (Exception $e) {
    echo 'Exception when calling SchemaApi->schemaAst: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::SchemaApi;

my $api_instance = WWW::SwaggerClient::SchemaApi->new();
my $languageId = languageId_example; # String | should indicate a supported language. At this time COBOL and PLSQL are the values supported

eval { 
    $api_instance->schemaAst(languageId => $languageId);
};
if ($@) {
    warn "Exception when calling SchemaApi->schemaAst: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.SchemaApi()
languageId = languageId_example # String | should indicate a supported language. At this time COBOL and PLSQL are the values supported

try: 
    # Returns the JSON Schema of the AST created by the corresponding parser
    api_instance.schema_ast(languageId)
except ApiException as e:
    print("Exception when calling SchemaApi->schemaAst: %s\n" % e)

Parameters

Path parameters
Name Description
languageId*
String
should indicate a supported language. At this time COBOL and PLSQL are the values supported
Required

Responses

Status: 200 - OK