File: ThemeImporterPHP.cpp

package info (click to toggle)
codelite 17.0.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 136,244 kB
  • sloc: cpp: 491,547; ansic: 280,393; php: 10,259; sh: 8,930; lisp: 7,664; vhdl: 6,518; python: 6,020; lex: 4,920; yacc: 3,123; perl: 2,385; javascript: 1,715; cs: 1,193; xml: 1,110; makefile: 804; cobol: 741; sql: 709; ruby: 620; f90: 566; ada: 534; asm: 464; fortran: 350; objc: 289; tcl: 258; java: 157; erlang: 61; pascal: 51; ml: 49; awk: 44; haskell: 36
file content (80 lines) | stat: -rw-r--r-- 4,454 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include "ThemeImporterPHP.hpp"

#include "macros.h"

#include <wx/stc/stc.h>

ThemeImporterPHP::ThemeImporterPHP()
{
    SetKeywords4("implements abstract and array as bool boolean break case cfunction class const continue declare "
                 "default die directory do double echo else elseif empty enddeclare endfor endforeach endif endswitch "
                 "endwhile eval exit extends false float for foreach function global if include include_once int "
                 "integer isset list new null object old_function or parent print real require require_once resource "
                 "return static stdclass string switch true unset use var while xor __class__ __file__ __function__ "
                 "__line__ __sleep __namespace__ __trait__ __wakeup public protected private trait interface namespace "
                 "final throw extends try catch self yield");

    // Javascript keywords
    SetKeywords1("break do instanceof  typeof case else new var catch finally return void continue for switch while "
                 "debugger function this with default if throw delete in try abstract  export interface  static "
                 "boolean  extends "
                 "long super"
                 "byte final native synchronized char float package throws class goto private transient const "
                 "implements  protected "
                 " volatile double import  public enum "
                 "int short null true false");
    SetFileExtensions("*.php;*.php3;*.phtml;*.inc;*.php5");
}

ThemeImporterPHP::~ThemeImporterPHP() {}

LexerConf::Ptr_t ThemeImporterPHP::Import(const wxFileName& theme_file)
{
    LexerConf::Ptr_t lexer = InitializeImport(theme_file, "php", wxSTC_LEX_HTML);
    CHECK_PTR_RET_NULL(lexer);

    // PHP can also be found in a file which contains HTML and JavaScript
    // so we define them all here

    // HTML
    AddProperty(lexer, wxSTC_H_DEFAULT, "HTML Default", m_editor);
    AddProperty(lexer, wxSTC_H_TAG, "HTML Tag", m_variable);
    AddProperty(lexer, wxSTC_H_TAGUNKNOWN, "Unknown HTML Tag", m_variable);
    AddProperty(lexer, wxSTC_H_ATTRIBUTE, "HTML Attribute", m_klass);
    AddProperty(lexer, wxSTC_H_ATTRIBUTEUNKNOWN, "Unknown HTML Attribute", m_klass);
    AddProperty(lexer, wxSTC_H_NUMBER, "HTML Number", m_number);
    AddProperty(lexer, wxSTC_H_DOUBLESTRING, "HTML Double String", m_string);
    AddProperty(lexer, wxSTC_H_SINGLESTRING, "HTML Single String", m_string);
    AddProperty(lexer, wxSTC_H_OTHER, "HTML Other", m_editor);
    AddProperty(lexer, wxSTC_H_COMMENT, "HTML Comment", m_multiLineComment);
    AddProperty(lexer, wxSTC_H_ENTITY, "HTML Entity", m_editor);

    // Embedded JavaScript
    AddProperty(lexer, wxSTC_HJ_START, "JS Start", m_editor);
    AddProperty(lexer, wxSTC_HJ_DEFAULT, "JS Default", m_editor);
    AddProperty(lexer, wxSTC_HJ_COMMENT, "JS Comment", m_singleLineComment);
    AddProperty(lexer, wxSTC_HJ_COMMENTLINE, "JS MultiLine Comment", m_multiLineComment);
    AddProperty(lexer, wxSTC_HJ_COMMENTDOC, "JS Doc Comment", m_multiLineComment);
    AddProperty(lexer, wxSTC_HJ_NUMBER, "JS Number", m_number);
    AddProperty(lexer, wxSTC_HJ_WORD, "JS Word", m_editor);
    AddProperty(lexer, wxSTC_HJ_KEYWORD, "JS Keyword", m_keyword);
    AddProperty(lexer, wxSTC_HJ_DOUBLESTRING, "JS Double String", m_string);
    AddProperty(lexer, wxSTC_HJ_SINGLESTRING, "JS Single String", m_string);
    AddProperty(lexer, wxSTC_HJ_SYMBOLS, "JS Symbols", m_editor);
    AddProperty(lexer, wxSTC_HJ_STRINGEOL, "JS String EOL", m_string);
    AddProperty(lexer, wxSTC_HJ_REGEX, "JS Regex", m_klass);

    // PHP
    AddProperty(lexer, wxSTC_HPHP_COMPLEX_VARIABLE, "PHP Complex Variable", m_variable);
    AddProperty(lexer, wxSTC_HPHP_DEFAULT, "PHP Default", m_editor);
    AddProperty(lexer, wxSTC_HPHP_HSTRING, "PHP Heredoc String", m_string);
    AddProperty(lexer, wxSTC_HPHP_SIMPLESTRING, "PHP String", m_string);
    AddProperty(lexer, wxSTC_HPHP_WORD, "PHP Word", m_keyword);
    AddProperty(lexer, wxSTC_HPHP_NUMBER, "PHP Number", m_number);
    AddProperty(lexer, wxSTC_HPHP_VARIABLE, "PHP Variable", m_variable);
    AddProperty(lexer, wxSTC_HPHP_COMMENTLINE, "PHP Comment", m_singleLineComment);
    AddProperty(lexer, wxSTC_HPHP_COMMENT, "PHP Multiline Comment", m_multiLineComment);
    AddProperty(lexer, wxSTC_HPHP_HSTRING_VARIABLE, "PHP Heredoc Variable", m_variable);
    FinalizeImport(lexer);
    return lexer;
}