input
stringlengths
10
828
output
stringlengths
5
107
public void set variable string name string value f variables put name value
defines the value of a variable
public string get variable string name return string f variables get name
returns the value of a defined variable
public boolean is resolved template context context return false
returns whether this variable is resolved
public int get completion offset return f completion offset
returns the completion offset within the string of the context
public void add context type context type f context types put context type get name context type
adds a context type to the registry
public void remove context type context type f context types remove context type get name
removes a context type from the registry
public int get completion length return f completion length
returns the completion length within the string of the context
public context type get context type string name return context type f context types get name
returns the context type if the name is valid code null code otherwise
public iterator iterator return f context types key set iterator
returns an iterator over the registered context type names
public string get key int offset get start int length get end offset try return f document get offset length catch bad location exception e return non nls 1
returns the keyword which triggered template insertion
public int get start return f completion offset
returns the beginning offset of the keyword
public int get end return f completion offset f completion length
returns the end offset of the keyword
public char get character before start int start get start try return start 0 get document get char start 1 catch bad location exception e return
returns the character before start position of completion
public int get indentation level int start get start text buffer text buffer text buffer create get document get string line content text buffer get line content of offset start return strings compute indent line content harbour uiplugin get default get preference store get int csource viewer configuration preference tab width
returns the indentation level at the position of code completion
public void add variable template variable variable f variables put variable get name variable
adds a template variable to the context type
public void add from file file file throws core exception input stream stream null try stream new file input stream file add from stream stream catch ioexception e throw read exception e finally try if stream null stream close catch ioexception e
convenience method for reading templates from a file
public void remove variable template variable variable f variables remove variable get name
removes a template variable from the context type
public void remove all variables f variables clear
removes all template variables from the context type
public iterator variable iterator return f variables values iterator
returns an iterator for the variables known to the context type
public void save to file file file throws core exception output stream stream null try stream new file output stream file save to stream stream catch ioexception e throw write exception e finally try if stream null stream close catch ioexception e
convenience method for saving to a file
public string get default value return f default value
returns the default value of the position
public void add template template if exists template return ignore duplicate f templates add template sort
adds a template to the set
public void set length int length f length length
sets the length of the position
public void set offsets int offsets f offsets offsets
sets the offsets of the position
public void remove template template f templates remove template sort
removes a template to the set
public void set resolved boolean resolved f resolved resolved
sets the resolved flag of the position
public boolean is resolved return f resolved
returns code true code if the position is resolved code false code otherwise
public void clear f templates clear sort
empties the set
public text range get source range return f source
returns the move text edits source range
public text range get target range return f target
returns the move text edits target range
public int get length return f document get length
returns the number of characters in this text buffer
public int get number of lines return f document get number of lines
returns the number of lines in this text buffer
public char get char int offset try return f document get char offset catch bad location exception e throw new array index out of bounds exception e get message
returns the character at the given offset in this text buffer
protected void set text range text range range f range range assert is not null f range
sets the text edits range
public string get content return f document get
returns the whole content of the text buffer
public string get content int start int length try return f document get start length catch bad location exception e return null
returns length characters starting from the specified position
public void add multi text edit edit assert is not null edit f children add edit
adds all code text edits code managed by the given multt text edit
public void add text edit edit assert is not null edit f children add edit
adds a text edit
public iterator iterator return f children iterator
returns the children managed by this text edit collection
public void connect text buffer editor editor throws core exception for iterator iter f children iterator iter has next object element iter next if element instanceof text edit editor add text edit element else editor add multi text edit element
connects this text edit to the given code text buffer editor code
public string get line delimiter string line delimiter get line delimiter 0 if line delimiter null line delimiter system get property line separator n non nls 1 non nls 2 return line delimiter
returns the preferred line delimiter to be used for this text buffer
public multi text edit copy throws core exception return new multi text edit f children
creates and returns a copy of this text edit collection
public text range get text range int size f children size if size 0 return new text range 0 0 text range range text edit f children get 0 get text range int start range get offset int end range get inclusive end for int i 1 i size i range text edit f children get i get text range start math min start range get offset end math max end range get inclusive end return new text range start end start 1
returns the code text range code that this text edit is going to
public string get line delimiter int line try return f document get line delimiter line catch bad location exception e return null
returns the line delimiter used for the given line number
public object get modified element return null
returns the element modified by this text edit
public string get line content int line try iregion region f document get line information line return f document get region get offset region get length catch bad location exception e return null
returns the line for the given line number
public int get line indent int line number int tab width return get indent get line content line number tab width
returns the line indent for the given line
public text region get line information int line try return new document region f document get line information line catch bad location exception e return null
returns a region of the specified line
public text region get line information of offset int offset try return new document region f document get line information of offset offset catch bad location exception e return null
returns a line region of the specified offset
public int get line of offset int offset try return f document get line of offset offset catch bad location exception e return 1
returns the line number that contains the given position
public string get line content of offset int offset try iregion region f document get line information of offset offset return f document get region get offset region get length catch bad location exception e return null
returns the line that contains the given position
public text buffer get text buffer return f buffer
returns the text buffer this editor is working on
public void add text edit edit throws core exception assert is true f mode undefined f mode redo internal add edit f mode redo
adds a code text edit code to this text editor
public void replace int offset int length string text throws core exception try f document replace offset length text catch bad location exception e istatus s new status istatus error harbour uiplugin plugin id cstatus constants internal error text manipulation messages get formatted string text buffer wrong range non nls 1 new object new integer offset new integer length e throw new core exception s
subsitutes the given text for the specified text position
public void add multi text edit edit throws core exception assert is true f mode undefined f mode redo edit connect this f mode redo
adds a code multi text edit code to this text editor
public void add undo memento undo throws core exception assert is true f mode undefined list list undo f edits add them reverse since we are adding undos for int i list size 1 i 0 i internal add text edit list get i f mode undo f mode
adds a code undo memento code to this text editor
public void connect text buffer editor editor throws core exception does nothing
connects this text edit to the given code text buffer editor code
public void clear f root node null f mode undefined f edits clear
clears the text buffer editor
public int get inclusive end return f offset f length 1
returns the inclusive end position of this range
public int get exclusive end return f offset f length
returns the exclusive end position of this range
public text range copy if is undefined return this return new text range f offset f length
creates a copy of this code text range code
public boolean is undefined return undefined this
returns code true code if this text range is the code undefined code
public boolean is valid return f offset 0 f length 0
checks if this code text range code is valid
public cdocument provider get document provider if document provider null document provider new cdocument provider return document provider
returns the used document provider
public ctext tools get text tools if text tools null text tools new ctext tools return text tools
returns the shared text tools
public problem marker manager get problem marker manager if f problem marker manager null f problem marker manager new problem marker manager return f problem marker manager
returns the problem marker manager
public void resource changed final iresource change event event final iresource delta delta event get delta control ctrl viewer get control if ctrl null ctrl is disposed ctrl get display sync exec new runnable public void run process delta delta
the workbench has changed
protected iharbour element get adapter object o if o instanceof iadaptable return null return iharbour element iadaptable o get adapter iharbour element class
returns the implementation of iworkbench adapter for the given
protected void parse string name string tokenizer tok new string tokenizer name while tok has more tokens names add element tok next token
parse a c namespace declaration into seperate names
public void init int size allocate buffer buffer new char size other initialization size less one size 1 offset 0 nbr entries 0
initialize the queue
private void append char name string buffer sb int c switch c case 65535 65535 char 1 eof sb append eof break case n sb append n break case r sb append r break case t sb append t break default sb append sb append char c sb append break
append a char to the msg buffer
public void abort grammar if grammar null grammar get class name null grammars remove grammar get class name grammar null
abort the processing of a grammar due to syntax errors
public void gen action element action no op
generate code for the given grammar element
public void gen line no int line if line 0 line if gen hash lines println line line antlr tool file minus path antlr tool grammar file
generate a line or line depending on options
public void gen char literal element atom if atom not print print htmlencode atom atom text
generate code for the given grammar element
public void gen char range element r print r begin text r end text
generate code for the given grammar element
public void gen rule ref element rr rule symbol rs rule symbol grammar get symbol rr target rule generate the actual rule description print link linkend quote for id rr target rule print rr target rule print link rk leave out args if rr args null print rr args print
generate code for the given grammar element
public void gen string literal element atom if atom not print print htmlencode atom atom text print
generate code for the given grammar element
public void gen token range element r print r begin text r end text
generate code for the given grammar element
public void gen token ref element atom if atom not print print atom atom text print
generate code for the given grammar element
public void gen follow set for rule block rule block blk lookahead follow grammar the llk analyzer follow 1 blk end node print set grammar maxk 1 follow
generate a textual representation of the follow set
public void reset grammar null
get ready to process a new grammar
public void gen lookahead set for block alternative block blk find the maximal lookahead depth over all alternatives int depth 0 for int i 0 i blk alternatives size i alternative alt blk get alternative at i if alt lookahead depth grammar analyzer nondeterministic depth grammar maxk break else if depth alt lookahead depth depth alt lookahead depth for int i 1 i depth i lookahead lookahead grammar the llk analyzer look i blk print set depth i lookahead
generate a textual representation of the lookahead set
public void gen alternative block blk if debug code generator system out println gen blk println gen block preamble blk gen block init action blk tell ast generation to build subrule result string save current astresult current astresult if blk get label null current astresult blk get label boolean ok grammar the llk analyzer deterministic blk cpp block finishing info how to finish gen common block blk true gen block finish how to finish throw no viable println restore previous ast generation current astresult save current astresult
generate code for the given grammar element
public void set char vocabulary bit set b grammar should enforce that this is only called for lexer lexer grammar grammar set char vocabulary b
set the character vocabulary for a lexer
protected void gen syn pred syn pred block blk no op
generate the syntactic predicate
public void gen char range element r if r get label null syntactic pred level 0 println r get label lt1 value correctly take care of save index stuff boolean save grammar instanceof lexer grammar save text r get auto gen type grammar element auto gen bang if save println save index text length println match range text or char r begin text text or char r end text if save println text set length save index
generate code for the given grammar element
public void gen lexer grammar g throws ioexception if debugging create a new sempred vector for this grammar if g debugging output sem preds new vector set grammar g if grammar instanceof lexer grammar antlr tool panic internal error generating lexer gen body g gen include g
generate the lexer c files
public void gen parser grammar g throws ioexception if debugging set up a new vector to keep track of sempred strings for this grammar if g debugging output sem preds new vector set grammar g if grammar instanceof parser grammar antlr tool panic internal error generating parser gen body g gen include g
generate the parser c file
public void add object o append o
add an object to the end of the list
public enumeration elements return new llenumeration this
return an enumeration of the list elements
public int height return length
how high is the stack
public void push object o insert head o
push an object onto the stack
public void gen token ref element atom if debug code generator system out println gen token ref atom if grammar instanceof lexer grammar antlr tool panic token reference found in lexer gen error try for element atom assign token value to token label variable if atom get label null syntactic pred level 0 println atom get label lt1 value ast gen element ast atom matching gen match atom gen error catch for element atom tack on tree cursor motion if doing a tree walker if grammar instanceof tree walker grammar println t t get next sibling
generate code for the given grammar element
public void remove tracking of rule refs grammar g for int i 0 i alternatives size i alternative alt get alternative at i alternative element elem alt head while elem null if elem instanceof rule ref element rule ref element rr rule ref element elem rule symbol rs rule symbol g get symbol rr target rule if rs null grammar antlr tool error rule rr target rule referenced in but not defined else rs references remove element rr else if elem instanceof alternative block recurse into subrules alternative block elem remove tracking of rule refs g elem elem next
walk the syntactic predicate and for a rule ref r remove
public void gen tree walker grammar g throws ioexception set grammar g if grammar instanceof tree walker grammar antlr tool panic internal error generating tree walker gen body g gen include g
generate the tree parser c files
public void tab int c get column int nc c 1 tabsize 1 tabsize 1 calculate tab stop set column nc set offset get offset nc c
advance the current column number by an appropriate amount
public void process arguments string args for int i 0 i args length i if args i equals trace trace rules true antlr tool set arg ok i else if args i equals trace tree parser trace rules true antlr tool set arg ok i else if args i equals debug debugging output true super class parseview debugging tree walker tool set arg ok i
process command line arguments
public boolean set option string key token value if key equals build ast if value get text equals true build ast true else if value get text equals false build ast false else antlr tool error build ast option must be true or false get filename value get line value get column return true if key equals astlabel type super set option key value return true if super set option key value return true antlr tool error invalid option key get filename value get line value get column return false
set tree parser options
public void begin exception spec token label hack the label string a bit to remove leading trailing space if label null label set text string utils strip front string utils strip back label get text n r t n r t super begin exception spec label don t check for current exception spec null because syntax errors may leave it set to something current exception spec new exception spec label
add an exception spec to an exception group or rule block