CNDLanguageModelAPIDiscussions

C/C++ language model API dicussions page

[[{TableOfContent} | {TableOfContent}]]

Clients

Code model clients

  • Class View (CV)
  • Navigator (Nav)
  • Code Completion (CC)
  • Hyper link (HL)
  • Semantic Highlighting (SH)
  • Syntax Error Highlighting (SEH)
  • Find Usages (FU)
  • Up to date staus (US)
  • Refactoring (RF)
  • Formatter (Fm)
  • Indenter (In)
  • Audits (Ad)
  • Metrics (Mt)
  • Call graph (CG)
  • Debugger (DBG)
  • Profiler (Prof)
  • Bridge to other languages (Assembler, Fortran, Java, UML) (Lang)

Use cases

Class view:

  • logical structure of project (name spaces, classifiers, typedefs, functions, variables)
  • resolver (find definitions/declarations, find classifier by typedef)
  • event (change declarations, open/close projects)

Navigator:

  • logical and physical structure of file (name space definitions, classifiers, functions, variables, macros, include directives, using, forward declarations)
  • event (change files)
  • code context (declaration level)

Code completion:

  • logical and physical structure of file (name space definitions, classifiers, functions, variables, declarations in body)
  • code context (high detailed context identifier/scope/statement/expression/neighbors)
  • logical structure of project (name spaces, classifiers, typedefs, functions, variables)
  • resolver (find referenced object)

Hyper link:

  • code context (scope/identifier in expanded and not expanded code)
  • resolver (find referenced object)

Semantic highlighting:

  • code visitor (file/declaration/statement/expression in expanded and not expanded code)
  • resolver (find referenced object)

Syntax error highlighting:

  • access to parser errors

Find usages:

  • code context (scope/identifier in expanded and not expanded code)
  • resolver (find referenced object)
  • code visitor (file/declaration/statement/expression in expanded and not expanded code, in active and not active code)

Up to date status:

  • event (change file, file state, open/close projects)

Refactoring:

  • code context and selection
  • resolver (find referenced object)
  • code visitor (file/declaration/statement/expression in expanded and not expanded code, in active and not active code)
  • code update (change modifier, visibility, synchronize definition/declaration, remove/insert code block or declaration)

Formatter:

  • AST tree (for unexpanded and expanded code in active and not active code)

Indenter:

  • code context (high detailed context identifier/scope/statement/expression/neighbors)

Call graph:

  • code context (scope/identifier, expanded and not expanded code)
  • resolver (find referenced object)
  • code visitor (declaration/referenced expression in expanded, in active code)

Audits:

  • code context (scope)
  • code visitor (file/declaration/statement/expression in expanded and not expanded code, in active code and not active code)
  • logical structure of project (name spaces, classifiers, typedefs, functions, variables)
  • code update (change modifier, visibility, synchronize definition/declaration, remove/insert code block or declaration)
  • access to comments

Metrics:

  • code context (scope)
  • logical structure of project (name spaces, classifiers, typedefs, functions, variables)
  • code visitor (file/declaration/statement/expression in expanded and not expanded code, in active code and not active code)
  • access to comments

Debugger:

  • resolver (find definitions/declarations/classifiers)

Profiler:

  • resolver (find definitions/declarations/classifiers)

Bridge to other languages (Assembler, Fortran, Java, UML):

  • resolver (find definitions/declarations/classifiers)
  • logical structure of code (name spaces, classifiers, typedefs, functions, variables)

Use cases summary

logical structure of project

  • name spaces
  • classifiers
  • typedefs
  • functions
  • variables

logical and physical structure of file

  • name space definitions
  • classifiers
  • typedefs
  • functions
  • variables
  • declarations in body
  • macros
  • include directives
  • using
  • forward declarations

event

  • change declarations
  • open/close projects
  • change files
  • file state

resolver

  • find definitions/declarations
  • find classifier by typedef
  • find referenced object

code context

  • declaration level
  • high detailed context identifier/scope/statement/expression/neighbors
  • scope/identifier in expanded and not expanded code

code selection

code visitor

  • file in expanded and not expanded code, in active and not active code
  • declaration in expanded and not expanded code, in active and not active code
  • statement in expanded and not expanded code, in active and not active code
  • expression in expanded and not expanded code, in active and not active code

access to comments

code update

  • change modifier
  • change visibility
  • synchronize definition/declaration
  • remove/insert code block or declaration

parser

  • access to errors
  • AST tree (for unexpanded and expanded code in active and not active code)

Current Flaws

Current code model API flaws

Fundamental:

  1. Too few details. No AST details in model. (e.g. lucene::analysis::Analyzer::tokenStream isn't divided by ::)
  2. Absence of inactive preprocessor branches
  3. Absence of connection between expanded objects and macro expansion

Less fundamental

  1. Absence of expressions in model
  2. Types representation (CsmType interface) is too primitive
  3. No long living object (object that can survive reparsing)
  4. Absence of code visitors
  5. Absence of comments in model
  6. No access to parser error

Api sketch

CNDLanguageModelSketch


Issuezilla

Status Whiteboard keyword: api (use in conjunction with "codemodel" subcomponent)

(click on the keyword above to get issues list)

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo