Package org.netbeans.modules.php.editor.parser.astnodes

Examples of org.netbeans.modules.php.editor.parser.astnodes.Expression


    /**
     * Test of getStringValue method, of class YiiCodeUtils.
     */
    @Test
    public void testGetStringValue() {
        Expression e = null;
        String result = YiiCodeUtils.getStringValue(e);
        assertEquals("", result);

        Scalar scalar = new Scalar(0, 0, "1", Scalar.Type.INT);
        assertEquals("", YiiCodeUtils.getStringValue(scalar));
View Full Code Here


        for (JLabel key : componentsMap.keySet()) {
            JTextField value = componentsMap.get(key);
            String valueText = value.getText();
            if (valueText.isEmpty()) {
                FormalParameter param = params.get(count);
                Expression defaultValue = param.getDefaultValue();
                if (defaultValue != null) {
                    count++;
                    continue;
                }
            }
View Full Code Here

        private final Set<String> themeName = new HashSet<String>();

        @Override
        public void visit(ArrayElement node) {
            super.visit(node);
            Expression key = node.getKey();
            String keyName = YiiCodeUtils.getStringValue(key);
            if (keyName.equals(THEME)) {
                String value = YiiCodeUtils.getStringValue(node.getValue());
                if (!value.isEmpty()) {
                    themeName.add(value);
View Full Code Here

        @Override
        public void visit(Assignment node) {
            Type operator = node.getOperator();
            if (methodName.equals(YiiUtils.getActionMethodName(viewName))
                    && operator == Type.EQUAL) {
                Expression rightHandSide = node.getRightHandSide();
                if (rightHandSide instanceof ClassInstanceCreation) {
                    Variable leftVariable = null;
                    VariableBase leftHandSide = node.getLeftHandSide();
                    if (leftHandSide instanceof Variable) {
                        leftVariable = (Variable) leftHandSide;
View Full Code Here

                    || !"$this".equals(CodeUtils.extractVariableName((Variable) node.getDispatcher()))) { // NOI18N
                return;
            }

            List<Expression> params = fi.getParameters();
            Expression expression;

            if (params.size() > 1) {
                expression = params.get(1);
            } else {
                return;
            }

            if (expression instanceof ArrayCreation) {
                ArrayCreation array = (ArrayCreation) expression;
                List<ArrayElement> elements = array.getElements();
                for (ArrayElement element : elements) {
                    Expression key = element.getKey();
                    if (!(key instanceof Scalar)) {
                        continue;
                    }
                    Scalar s = (Scalar) key;
                    String varName = ""; // NOI18N
View Full Code Here

        }

        @Override
        public void visit(ArrayElement node) {
            super.visit(node);
            Expression key = node.getKey();
            if (key instanceof Scalar) {
                Scalar s = (Scalar) key;
                if (s.getScalarType() == Scalar.Type.STRING) {
                    String keyValue = s.getStringValue();
                    keyValue = keyValue.substring(1, keyValue.length() - 1);
View Full Code Here

    }

    @Override
    public void visit(StaticMethodInvocation node) {
        super.visit(node);
        Expression classNameExpression = node.getClassName();
        String className = CodeUtils.extractQualifiedName(classNameExpression);
        if (!VIEW_CLASS.equals(className) && !VIEW_MODEL_CLASS.equals(className)) {
            return;
        }
        FunctionInvocation fi = node.getMethod();
        String invokedMethodName = CodeUtils.extractFunctionName(fi);
        if (!FORGE_METHOD.equals(invokedMethodName)) {
            return;
        }
        // get method parameters
        List<Expression> parameters = fi.getParameters();
        Expression e = null;
        if (!parameters.isEmpty()) {
            e = parameters.get(0);
        }
        String path = ""; // NOI18N
        if (e instanceof Scalar) {
View Full Code Here

TOP

Related Classes of org.netbeans.modules.php.editor.parser.astnodes.Expression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.