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 |