mirror of
https://github.com/adelphes/android-dev-ext.git
synced 2025-12-23 09:59:25 +00:00
remove Value class, add NewExpression and separate out Any classes
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
const { ValueBase } = require("../body-types");
|
||||
|
||||
class Expression extends ValueBase {
|
||||
class Expression {
|
||||
}
|
||||
|
||||
exports.Expression = Expression;
|
||||
|
||||
35
langserver/java/expressiontypes/NewExpression.js
Normal file
35
langserver/java/expressiontypes/NewExpression.js
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* @typedef {import('../tokenizer').Token} Token
|
||||
* @typedef {import('../body-types').ResolvedIdent} ResolvedIdent
|
||||
* @typedef {import('java-mti').JavaType} JavaType
|
||||
*/
|
||||
const { Expression } = require("./Expression");
|
||||
|
||||
class NewArray extends Expression {
|
||||
/**
|
||||
* @param {JavaType} element_type
|
||||
* @param {ResolvedIdent} dimensions
|
||||
*/
|
||||
constructor(element_type, dimensions) {
|
||||
super();
|
||||
this.element_type = element_type;
|
||||
this.dimensions = dimensions;
|
||||
}
|
||||
}
|
||||
|
||||
class NewObject extends Expression {
|
||||
/**
|
||||
* @param {JavaType} object_type
|
||||
* @param {ResolvedIdent[]} ctr_args
|
||||
* @param {Token[]} type_body
|
||||
*/
|
||||
constructor(object_type, ctr_args, type_body) {
|
||||
super();
|
||||
this.element_type = object_type;
|
||||
this.ctr_args = ctr_args;
|
||||
this.type_body = type_body;
|
||||
}
|
||||
}
|
||||
|
||||
exports.NewArray = NewArray;
|
||||
exports.NewObject = NewObject;
|
||||
19
langserver/java/expressiontypes/literals/Instance.js
Normal file
19
langserver/java/expressiontypes/literals/Instance.js
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @typedef {import('../../tokenizer').Token} Token
|
||||
* @typedef {import('java-mti').CEIType} CEIType
|
||||
*/
|
||||
const { LiteralValue } = require('./LiteralValue');
|
||||
|
||||
class InstanceLiteral extends LiteralValue {
|
||||
/**
|
||||
*
|
||||
* @param {Token} token 'this' or 'super' token
|
||||
* @param {CEIType} scoped_type
|
||||
*/
|
||||
constructor(token, scoped_type) {
|
||||
super(token);
|
||||
this.scoped_type = scoped_type;
|
||||
}
|
||||
}
|
||||
|
||||
exports.InstanceLiteral = InstanceLiteral;
|
||||
Reference in New Issue
Block a user