2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com
.intellij
.lang
.xhtml
;
18 import com
.intellij
.lang
.ASTNode
;
19 import com
.intellij
.lang
.xml
.XMLParserDefinition
;
20 import com
.intellij
.lexer
.Lexer
;
21 import com
.intellij
.lexer
.XHtmlLexer
;
22 import com
.intellij
.openapi
.project
.Project
;
23 import com
.intellij
.xml
.util
.XmlUtil
;
24 import com
.intellij
.psi
.PsiFile
;
25 import com
.intellij
.psi
.FileViewProvider
;
26 import com
.intellij
.psi
.xml
.XmlElementType
;
27 import com
.intellij
.psi
.impl
.source
.xml
.XmlFileImpl
;
28 import org
.jetbrains
.annotations
.NotNull
;
31 * Created by IntelliJ IDEA.
35 * To change this template use File | Settings | File Templates.
37 public class XHTMLParserDefinition
extends XMLParserDefinition
{
40 public Lexer
createLexer(Project project
) {
41 return new XHtmlLexer();
44 public SpaceRequirements
spaceExistanceTypeBetweenTokens(ASTNode left
, ASTNode right
) {
45 final Lexer lexer
= createLexer(left
.getPsi().getProject());
46 return XmlUtil
.canStickTokensTogetherByLexerInXml(left
, right
, lexer
, 0);
49 public PsiFile
createFile(FileViewProvider viewProvider
) {
50 return new XmlFileImpl(viewProvider
, XmlElementType
.XHTML_FILE
);